diff --git a/scripts/4_World/YALootBoxes_ActionOpen.c b/scripts/4_World/YALootBoxes_ActionOpen.c index 081498c..bc0e4df 100644 --- a/scripts/4_World/YALootBoxes_ActionOpen.c +++ b/scripts/4_World/YALootBoxes_ActionOpen.c @@ -57,11 +57,16 @@ class YALB_ActionOpenLootbox : ActionContinuousBase return true; } - override int GetDuration(ActionData action_data) + // Continuous-action duration is set via a CAContinuousTime component (in + // SECONDS), NOT a GetDuration() override - ActionContinuousBase has no such + // method. Falls back to 5s on the client, where MainConfig is null (config + // is server-only); the server is authoritative on when the channel ends. + override void CreateActionComponent() { - if (YALB_ConfigLoader.MainConfig) - return YALB_ConfigLoader.MainConfig.OpenChannelDurationSeconds * 1000; // ms - return 5000; + float secs = 5.0; + if (YALB_ConfigLoader.MainConfig && YALB_ConfigLoader.MainConfig.OpenChannelDurationSeconds > 0) + secs = YALB_ConfigLoader.MainConfig.OpenChannelDurationSeconds; + m_ActionData.m_ActionComponent = new CAContinuousTime(secs); } // Fired server-side when the channel completes WITHOUT being cancelled.