DayZ 1.24
Loading...
Searching...
No Matches
Switchable_Base.c
Go to the documentation of this file.
1class Switchable_Base extends ItemBase
2{
3 override void OnWasAttached(EntityAI parent, int slot_id)
4 {
5 super.OnWasAttached(parent, slot_id);
6
8 if (Class.CastTo(parent_item, parent))
9 parent_item.AddLightSourceItem(this);
10 }
11
12 override void OnWasDetached(EntityAI parent, int slot_id)
13 {
14 super.OnWasDetached(parent, slot_id);
15
17 if (Class.CastTo(parent_item, parent))
18 parent_item.RemoveLightSourceItem();
19 }
20
22 {
23 super.EEItemLocationChanged(oldLoc, newLoc);
24
25 if (GetLight())
26 GetLight().UpdateMode();
27 }
28}
Super root of all classes in Enforce script.
Definition EnScript.c:11
InventoryLocation.
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void OnWasAttached(EntityAI parent, int slot_id)
override ScriptedLightBase GetLight()
Definition TLRLight.c:13
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.