
[Event War] Eliminated Players Can Still Occupy Townblocks
Closed this issue ยท 1 comments
What steps will reproduce the problem?
- Declare a town war.
- Kill a user enough times to remove all their lives. We had 5 lives set and the user had died 6 times,
/res
confirmed they had no lives. - The dead user can still occupy/siege townblocks. It is unclear if they can initiate them or if they simply count as an attacker.
In the logs, the towns and players of interest are: Poland and Czechia, and EmperorDazed and SNEEZYFIVE31641
What is the expected output?
The user should neither count as an attacker or be able to initiate sieges. The same should be true of healing blocks however this was not tested.
Towny version
[TownyChat 0.117 TownyFlight 1.10.2 MapTowny 2.2.0 EventWar 0.0.157 TownyCamps 0.0.45 TownyHistories 0.0.33]
Server version
Current Purpur Version: 1.21.4-2412-9249a2c (MC: 1.21.4)*
Please use Pastebin.com to link the following files
- Your full server startup from the logs\latest.log: https://mclo.gs/kyOFNgS
- Your Eventwar config.yml: https://pastebin.com/eh7mt5V8
- Your townyperms.yml:
- Your log's error:
(optional) If this is to do with permissions,
5. Your permissions file:
(optional) If this is to do with chat,
6. Your chatconfig.yml:
7. Your channels.yml:
I have looked over the code on this one I don't believe a player without lives can actually add number of HP that will be reduced/added to a townblock under attack/being healed.
I check whether the WarParticipants warringResidents contain the player before they are able to get added:
Messaging.sendDebugMsg("[War] " + player.getName() + ": ");
Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId());
if (resident == null || !resident.hasTown() || !war.getWarParticipants().hasWarringResident(resident) || resident.isJailed())
continue;
There is an issue where the player is being counted in the total number of players but it is only used in the debug message:
Messaging.sendDebugMsg("[War] # Players: " + numPlayers);
I have fixed that now.
The next version will have the improved debug messaging.