public void DisableIfTSOCategoryWrong(VMContext context) { //if (context.VM.TS1) return; OBJD obj = Object.OBJ; if (MasterDefinition != null) { obj = MasterDefinition; } var category = context.VM.TSOState.PropertyCategory; var flag = (1 << category); if (category == 7) { flag |= 2; //money objects are allowed on welcome lots too. (fso change, disabling this is todo) } if (category != 255 && obj.LotCategories > 0 && (obj.LotCategories & flag) == 0) { Disabled |= VMGameObjectDisableFlags.LotCategoryWrong; } else { Disabled &= ~VMGameObjectDisableFlags.LotCategoryWrong; } }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); Direction = (Direction)reader.ReadByte(); if (Version > 9) { Disabled = (VMGameObjectDisableFlags)reader.ReadByte(); } }
public void Load(VMGameObjectMarshal input) { base.Load(input); Position = Position; Direction = input.Direction; Disabled = input.Disabled; if (UseWorld) { ((ObjectComponent)this.WorldUI).DynamicSpriteFlags = this.DynamicSpriteFlags; WorldUI.ObjectID = ObjectID; if (Slots != null && Slots.Slots.ContainsKey(0)) { ((ObjectComponent)WorldUI).ContainerSlots = Slots.Slots[0]; } SetValue(VMStackObjectVariable.Flags, GetValue(VMStackObjectVariable.Flags)); RefreshGraphic(); } }
public void DisableIfTSOCategoryWrong(VMContext context) { OBJD obj = Object.OBJ; if (MasterDefinition != null) { obj = MasterDefinition; } var category = context.VM.TSOState.PropertyCategory; if (category != 255 && obj.LotCategories > 0 && (obj.LotCategories & (1 << category)) == 0) { Disabled |= VMGameObjectDisableFlags.LotCategoryWrong; } else { Disabled &= ~VMGameObjectDisableFlags.LotCategoryWrong; } }
public override void Tick() { if ((Disabled & VMGameObjectDisableFlags.PendingRoommateDeletion) > 0) { //can we be deleted and moved back to inventory? maybe some stuff on us needs to be first. var context = Thread.Context; var current = DeepestObjInSlot(this, 0); if (current is VMGameObject && !current.IsInUse(context, true)) { if (current.PersistID > 0) { if (context.VM.IsServer && (Disabled & VMGameObjectDisableFlags.TransactionIncomplete) == 0) { context.VM.ForwardCommand(new VMNetSendToInventoryCmd() { InternalDispatch = true, ObjectPID = current.PersistID, }); } } } } if ((Disabled & VMGameObjectDisableFlags.ObjectLimitExceeded) > 0) { if ((Disabled & VMGameObjectDisableFlags.ObjectLimitThreadDisable) > 0) { return; } else if (!IsInUse(Thread.Context, true) && !PartOfPortal()) { Disabled |= VMGameObjectDisableFlags.ObjectLimitThreadDisable; } } base.Tick(); }