Jump to content

Turrets targeting NPCs

Closed 1.0.2 1.0.3

Wraith

Posted

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?

Cahnu

Posted

Thank you for the detailed info. It looks like you are exactly right in your findings. One of my other events that uses a similar code flow does actually contain the line you mentioned. I have had quite a bit of trouble recreating this issue so thank you for pinpointing not only how to recreate it but the line that was missing. I just put out an updated version to correct this.

  • Like 1
Cahnu

Posted

Changed Status from Pending to Work in Progress

Changed Fixed In to 1.0.3

Cahnu

Posted

Changed Status from Work in Progress to Closed

1.4m

Downloads

Total number of downloads.

6.8k

Customers

Total customers served.

101.5k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.