OnDeletedDynamicPVPFixed

I'm not sure from which version this started, but I only noticed it now. OnDeletedDynamicPVP is not always being called.
For example, if I spawn a crate(spawn codelockedhackablecrate), the OnCreatedDynamicPVP hook is called. But, when I remove this crate using(ent.kill), the zone is removed, but the OnDeletedDynamicPVP hook is not called.

DynamicPVP v4.10.0, latest ZoneManager, Carbon staging version.

Thanks I'll take a look.

Was the zone actually created when you deleted the crate, or was a creation delay in effect?

Merged post

Also, please try with debug logging enabled.

I don't see how this can happen, as there's only one place in code where zone delete happens, and it's not possible for the hook call to be skipped.

In fact, you should often get TWO delete hook calls, because DPVP calls it first before scheduling a delayed delete in case you want to cancel the delete, then calls it again when the actual deletion occurs. I'm not sure how that was ever useful to anyone, because it's not possible for another plugin to determine which of those two cases it's being called for.

Merged post

First, I was wrong about the hooks - there are two of them:

  1. OnDeleteDynamicPVP gets called before deleting the zone, and plugins can return non-null to prevent deletion (which is problematic IMO because then it just gets stuck forever)
  2. OnDeletedDynamicPVP gets called after deleting the zone, to notify plugins of zone deletion

Second, I can't replicate this. I tried adding debug logging and deleting a hackable crate with DPVP 4.10.0 on a non-staging test server, both with and without event stop delays, and both times it fired both hooks at the correct time.

Here is my version 4.10.0 with debug logging added if you want to try it: https://pastebin.com/CanTRSCp

Merged post

FYI, running a non-current version of Zone Manager seems to be causing issues. Make sure you're up to date.

Hello, I replied to you on Discord.

  • Hooks are firing properly when zones are deleted properly
  • 4.10 (and probably a few versions prior) has a bug in which crate zones were not un-parenting on crate kill unless the crate event was configured to stop on crate kill; this would cause the game to do a lower level zone delete than DPVP knows about
  • 5.0.0 has a bug where crate zones currently don't support parenting
  • Your config is set to run the event for 600 seconds and not react at all to crate kill, so with the above bugs fixed, I would expect the zone to last 600 seconds after the crate spawns, regardless of what happens to the crate 
I will get the bugs fixed soon and roll a 5.0.1 release.

Merged post

Fixed in 5.0.1
Locked automatically