H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
203 stars 80 forks source link

Fix 3 problems with `plSubWorldMsg`. #1485

Closed Hoikas closed 11 months ago

Hoikas commented 11 months ago

The impetus for this change is that Korman's new Change Subworld message node can cause all players in the Age to change to that subworld. The rationale here is that changing subworlds modifies a player's avatarPhysical SDL. So, really, we probably only want to be sending plSubWorldMsg to the local player from a Responder. Responders are primarily a zero-code artist logic tool, so they shouldn't have to care about that level of SDL detail. Further, there is precedent for major avatar/player related actions to be rejected from non-local sources. Namely, all camera messages are restricted in the same way in Responders.

As a bonus, I fixed a memory leak that wouldn't be detected by asan and fixed a logic error with the subworld SDL synch.

Hoikas commented 11 months ago

Update: I checked all of Cyan's responders, and none of them send subworld messages, so there is no danger of this breaking Cyan content.