From 73bef32efb6b1f11175f73b31cd65d59fdb4823c Mon Sep 17 00:00:00 2001 From: Treeku Date: Sat, 29 Mar 2014 03:15:04 +0000 Subject: [PATCH] Player flag is set when you align to a faction -> When you join a faction, #16 is set to true. When you go combatant, #32 is set to true. The resulting flag: 48 When you go SF, #1, #2 and #4 are set to true. The resulting flag: 55 When you go back to combatant, #1, #2 and #4 are set to false. The resulting flag: 48 The error was either in the Player flag not being set anywhere, or setPvpStatus setting it instead of doing OR/XOR operations. (The result of this would be bit #16 wouldn't be set to true, meaning SF would be 39 instead of 55) We could still set all of the flags to true for SF without harm for safety, it just wasn't theoretically necessary. Additionally any players that login automatically were getting #16 sent to the client by sendBaselines() regardless of if they had a faction, which should now be fixed. --- scripts/commands/pvp.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/commands/pvp.py b/scripts/commands/pvp.py index 54f1a40c..a42ea0dd 100644 --- a/scripts/commands/pvp.py +++ b/scripts/commands/pvp.py @@ -31,9 +31,16 @@ def run(core, actor, target, commandString): actor.setFaction('') actor.sendSystemMessage('@faction_recruiter:resign_complete', 0) + if commandString == 'neutral': + time.sleep(1) + actor.setFaction('') + actor.setPvpStatus(PvpStatus.Player, False) + actor.sendSystemMessage('@faction_recruiter:resign_complete', 0) + return time.sleep(1) actor.setFaction(commandString) + actor.setPvpStatus(PvpStatus.Player, True) return if faction == 'neutral' or faction == '':