twhl-community / halflife-unified-sdk

Half-Life Updated SDK with Opposing Force and Blue Shift merged in, along with other improvements. Check README.md for more information.
Other
147 stars 26 forks source link

Triggering NPCs no longer stops wait for trigger schedule #537

Open SamVanheer opened 1 year ago

SamVanheer commented 1 year ago

In vanilla Half-Life NPCs default to having a use function that forces their state to the alert state which stops the SCHED_WAIT_TRIGGER schedule. Because this function allowed NPCs to come back from the dead when triggered in the middle of their death schedule it was disabled, but this also broke triggering NPCs that have a targetname.

Not all NPCs can be triggered this way; if they use a different use function (like friendly NPCs having a follower use function) then it won't work anyway.

A proper solution for this is needed to make sure NPCs can be woken from their wait schedule. Otherwise they'll wait 5 seconds to activate their AI properly.