Fix World-module compile error: invalid GetDuration override
The script log showed the only remaining error after the module-binding fix: ActionContinuousBase has no GetDuration(ActionData) to override. Continuous action timing is set via a CAContinuousTime component (in seconds) inside CreateActionComponent(). Replaced the GetDuration override accordingly; falls back to 5s on the client where MainConfig is null (config is server-only, server stays authoritative on channel completion). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
663db39ab6
commit
910f972d3a
1 changed files with 9 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue