We are currently running the Heavy Military Tunnel event, but we have encountered issues with the turrets targeting NPCs in the tunnel. The event runs correctly the first time after a plugin reload, and the turrets do not target the NPCs. However, after stopping and restarting the event (without a plugin reload), the turrets attack the NPCs.
Testing was performed in a clean test environment. We unloaded all plugins except Vanish to remain hidden and NPCSpawn, which appears to be required by this event.
We suspect that the issue is related to the following method
public void SubscribeHooks(bool shouldSubscribe)
Currently, there is no call to subscribe to the hooks, while there is a call to unsubscribe. This may be by design, but it's just an observation at this point.
As a test, we added
SubscribeHooks(true)
in the setup event code
private void SetupEvent(bool isManual)
method just before the deploy NPCs call.
DeployNpcs()
After making this change, the event is behaving as expected, and the turrets are not killing the NPCs.
We are using this as a temporary 'fix', but unsure if this change may have any other negative impacts. Could you please review this to confirm?