270 {
272 {
273 bool isTimeTriggered = false;
274
275 array<ItemBase> attachmentsCache = new array<ItemBase>();
276 for (int attachmentIdx = 0; attachmentIdx < GetInventory().AttachmentCount(); attachmentIdx++)
277 {
278 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(attachmentIdx));
279 if (attachment)
280 attachmentsCache.Insert(attachment);
281 }
282
283 foreach (
ItemBase attachment1 : attachmentsCache)
284 attachment1.UnlockFromParent();
285
287 foreach (
ItemBase attachment2 : attachmentsCache)
288 {
290 {
291 isTimeTriggered = true;
292 break;
293 }
294 }
295
297 foreach (
ItemBase attachment3 : attachmentsCache)
298 {
299 if (attachment3)
300 {
301 vector dropExtents = "0.5 0.0 0.5";
302 if (isTimeTriggered)
303 dropExtents[1] = 0.15;
304
305 GetInventory().DropEntityInBounds(
InventoryMode.SERVER,
this, attachment3, dropExtents, 0, 0, 0);
307 attachment3.SetTakeable(false);
308 }
309 }
310
312 if (isTimeTriggered)
313 {
317 }
318 else
319 {
320 DeleteSafe();
321 }
322
324 foreach (
ItemBase attachment4 : attachmentsCache)
325 {
326 if (attachment4.IsAnyInherited({RemoteDetonator, ClockBase}))
327 {
330 }
331
332 if (attachment4 && !attachment4.IsAnyInherited({RemoteDetonator, ClockBase}))
333 {
334 Param1<ItemBase> params = new Param1<ItemBase>(attachment4);
337 }
338 }
339 }
340 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
const string ANIM_PHASE_VISIBILITY
class GP5GasMask extends MaskBase ItemBase
override ScriptCallQueue GetCallQueue(int call_category)
const float TIME_TRIGGER_DELAY_SECS
const float TIME_TRIGGER_INITIAL_DELAY_SECS
const float TIME_TRIGGER_TIMER_BASED_DELAY_SECS
proto void CallLaterByName(Class obj, string fnName, int delay=0, bool repeat=false, Param params=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto native CGame GetGame()