Exemplo n.º 1
0
 public void SetHeldEntity(BaseEntity ent)
 {
     if (!ent.IsValid())
     {
         this.heldEntity.Set((BaseEntity)null);
         this.MarkDirty();
     }
     else
     {
         if ((int)this.heldEntity.uid == ent.net.ID)
         {
             return;
         }
         this.heldEntity.Set(ent);
         this.MarkDirty();
         if (!ent.IsValid())
         {
             return;
         }
         HeldEntity heldEntity = ent as HeldEntity;
         if (!Object.op_Inequality((Object)heldEntity, (Object)null))
         {
             return;
         }
         heldEntity.SetupHeldEntity(this);
     }
 }
Exemplo n.º 2
0
 public void SetHeldEntity(BaseEntity ent)
 {
     if (!BaseEntityEx.IsValid(ent))
     {
         this.heldEntity.Set(null);
         MarkDirty();
     }
     else
     {
         if (this.heldEntity.uid == ent.net.ID)
         {
             return;
         }
         this.heldEntity.Set(ent);
         MarkDirty();
         if (BaseEntityEx.IsValid(ent))
         {
             HeldEntity heldEntity = ent as HeldEntity;
             if (heldEntity != null)
             {
                 heldEntity.SetupHeldEntity(this);
             }
         }
     }
 }