ago1024 / WurmServerModLauncher

Wurm Unlimited Mod Launcher
59 stars 21 forks source link

Fix incorrect "The X will not leave the server." message for modded items if target server is not known #43

Closed bdew closed 6 years ago

bdew commented 6 years ago

Communicator.checkLegalTileMove is calling PlayerTransfer.willItemsTransfer with targetServer=0, which means there is no mapping for the server and ModPlayerTransfer.willItemLeaveServer returns false.

This only seems to affect checks as the player is approaching a border, which causes a bunch of incorrect "The X will not leave the server." messages but doesn't affect the actual transfers.

I've made willItemLeaveServer return true if server id = 0 to prevent those incorrect messages.

ago1024 commented 6 years ago

I just added a similar fix with e1026f5ca72f9c6a23a9cf4365ae090ed08da3fe It prevents calling the hook if the targetserver id is 0 but will call the original willLeaveServer

bdew commented 6 years ago

Awesome, thanks.