I was wrong, not all bobbers are named "Bobber".
Just found that Projectile now has an extra field which determines if the given type is a bobber. This field is set in Projectile.SetDefaults method in the following logic
`((type >= 360 && type <= 366) || type == 381 || type == 382 || type == 760 || type == 775)`
I think it is reasonable to use the bobber field, as it would be updateproof too.
Tested and working. Fixes#1985
The actual issue was a missing `!` beind IsInRange. If player was doing a valid fishing event, it handled the NPC spawning.
I've split up the checks to make clearer debug messages.
Main.projectile objects are never null. Bobber projectile is never killed when the FishOutNPC event occurs. The projectile type in the check can only be 0 if no recent projectile found that has the name Bobber.
Fixes#1774.
This commit is designed to fix the clientside door desync issue. Based
on the order of events that I've been able to see, the way that door
opening works is like this:
1. Client sends a door open request.
2. Server echoes request back to client.
3. Both server and client simulate door opening.
4. The client that requests the initial door open sends a tile square to
the server for some reason.
In TShock, under all circumstances, we send a tile square back to the
client that sends one in, unless you have the
`tshock.ignore.sendtilesquare` permission. This adds a deviation: it
does not network data back if the event is just a door change. Doing
this is safe from the perspective of actual gameplay. A previous
iteration of this commit synchronized data to other clients, but that
seemed superfluous.
This does not really solve the underlying problem or answer the question
as to why sending a tile square back to the client seems to throw it
off, but it does. I was not able to replicate the desync issue anymore
with this branch. I expect that it will be safe to keep, because the
improved logic will only happen if the tile square had no effective
changes in addition to the door changes.
This is a combination of 3 commits:
* @Olink was right. Adding additional check. Modifying range check.
There are two ways to place food into a plate. One is by having it in hand (mouse) and right clicking, the other is by having the item selected in the... "inventory bar"(?) and right clicking the plate.
Tested range, if player is outside the range, they should not get their item back.
* FoodPlatterHotfix - Update IsInRange range value.
To suggestion of Olink, to consider player lag and increase the range check.
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
Run /sync if your doors disappear. This will resync your local client
with the server state. For more information, please see the associated
changelog entry.
This is called when a player is placing a fruit (item) in a plate.
Adding checks to see if they have permission to place or replace a fruit in the item.
Checks if they are within range. And a check to see if they are legitimately placing the item from their hand, and not by sending a raw packet.