MSRevive / MasterSwordRebirth

Continuation of Master Sword Classic/Continued.
https://msrebirth.net/
Other
9 stars 7 forks source link

'$func' script function doesn't run client side #33

Closed greatguys1 closed 1 year ago

greatguys1 commented 2 years ago

It simply returns '0' and doesn't run the event. Server side works fine.

Test this in the alpha script pack by turning on dev mode, then using this console command: . func

If it works client side, it'll report: "Client-side Result #n" of 2 results.

greatguys1 commented 2 years ago

Should specify this is for the alpha

SaintWish commented 2 years ago

For whatever reason m_Scripts is empty for the client whenever $func is ran, so a quick workaround fix for $func

if(m.pScriptedInterface->m_Scripts.size() > 0)
    m.pScriptedInterface->CallScriptEvent( func_event.c_str(), &OutParams );
else
    RunScriptEventByName(func_event.c_str(), &OutParams);

At some point we should go through and actually figure why m_Scripts would be empty for the client when $func is ran.