Fixed carry entity chain reaction

This commit is contained in:
Anuken
2018-07-05 16:01:12 -04:00
parent 23188df276
commit fc07c5efa6

View File

@@ -32,14 +32,14 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{
CallEntity.setCarryOf(this instanceof Player ? (Player)this : null, this, unit); CallEntity.setCarryOf(this instanceof Player ? (Player)this : null, this, unit);
} }
@Remote(called = Loc.server, targets = Loc.both, forward = true, in = In.entities) @Remote(called = Loc.both, targets = Loc.both, forward = true, in = In.entities)
static void dropSelf(Player player){ static void dropSelf(Player player){
if(player.getCarrier() != null){ if(player.getCarrier() != null){
player.getCarrier().dropCarry(); player.getCarrier().dropCarry();
} }
} }
@Remote(called = Loc.server, targets = Loc.both, forward = true, in = In.entities) @Remote(called = Loc.both, targets = Loc.both, forward = true, in = In.entities)
static void setCarryOf(Player player, CarryTrait trait, CarriableTrait unit){ static void setCarryOf(Player player, CarryTrait trait, CarriableTrait unit){
if(player != null){ //when a server recieves this called from a player, set the carrier to the player. if(player != null){ //when a server recieves this called from a player, set the carrier to the player.
trait = player; trait = player;