@@ -37,7 +37,9 @@ bool TEventExt::Execute(TEventClass* pThis, int iEvent, HouseClass* pHouse, Obje
37
37
CDTimerClass* pTimer, bool * isPersitant, TechnoClass* pSource, bool & bHandled)
38
38
{
39
39
bHandled = true ;
40
- switch (static_cast <PhobosTriggerEvent>(pThis->EventKind ))
40
+ const auto eventKind = static_cast <PhobosTriggerEvent>(pThis->EventKind );
41
+
42
+ switch (eventKind)
41
43
{
42
44
// helper struct
43
45
struct and_with { bool operator ()(int a, int b) { return a & b; } };
@@ -117,8 +119,6 @@ bool TEventExt::Execute(TEventClass* pThis, int iEvent, HouseClass* pHouse, Obje
117
119
case PhobosTriggerEvent::GlobalVariableAndIsTrueGlobalVariable:
118
120
return TEventExt::VariableCheckBinary<true , true , and_with>(pThis);
119
121
120
- case PhobosTriggerEvent::ShieldBroken:
121
- return ShieldClass::ShieldIsBrokenTEvent (pObject);
122
122
case PhobosTriggerEvent::HouseOwnsTechnoType:
123
123
return TEventExt::HouseOwnsTechnoTypeTEvent (pThis);
124
124
case PhobosTriggerEvent::HouseDoesntOwnTechnoType:
@@ -128,6 +128,27 @@ bool TEventExt::Execute(TEventClass* pThis, int iEvent, HouseClass* pHouse, Obje
128
128
case PhobosTriggerEvent::CellHasAnyTechnoTypeFromList:
129
129
return TEventExt::CellHasAnyTechnoTypeFromListTEvent (pThis, pObject, pHouse);
130
130
131
+ // If it requires an additional object as like mapping events 7 or 48, please fill it in here.
132
+ // case PhobosTriggerEvent::SomeTriggerAttachedToObject:
133
+ case PhobosTriggerEvent::ShieldBroken:
134
+ // They must be the same.
135
+ if (eventKind == static_cast <PhobosTriggerEvent>(iEvent))
136
+ {
137
+ switch (eventKind)
138
+ {
139
+ // SomeTriggerAttachedToObject needs to be restricted to situations where ...
140
+ // case PhobosTriggerEvent::SomeTriggerAttachedToObject:
141
+ // return ...::ThisAttachedToObjectTEvent(pObject, ...);
142
+
143
+ // ShieldBroken needs to be restricted to situations where the shield is being attacked.
144
+ case PhobosTriggerEvent::ShieldBroken:
145
+ return ShieldClass::ShieldIsBrokenTEvent (pObject);
146
+
147
+ default :
148
+ break ;
149
+ }
150
+ }
151
+
131
152
default :
132
153
bHandled = false ;
133
154
return true ;
0 commit comments