cityrpg / CityRPG

A sandbox-simulation styled mod for the game Blockland that simulates the life of a blocky city. Live, build, and thrive in a city made of blocks.
4 stars 3 forks source link

Mayor job isn't repealed if the player is no longer mayor #9

Closed homosapine closed 4 years ago

homosapine commented 4 years ago

This possibly can only happen if the player is offline when they lose their mayor status but I'm not sure

LakeYS commented 4 years ago

I believe this is caused by the mayor spot blanking itself out when the server restarts, without actually removing the existing mayor.

This can be theoretically fixed by saving and reloading the mayor value (as it should anyway), however a more foolproof solution might be to implement an additional check when the mayor joins.

As a workaround, I'll do occasional passes on the save data to ensure people aren't holding out with the mayor job.

Dglider commented 4 years ago

I would just do a check when a player joins.

LakeYS commented 4 years ago

It turns out there already is a check buried in the tick loop, it was just checking for the wrong job. This is being fixed.