TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
|
Re: Another weird thing... (+3)
Think I've finally tracked down the logic thread behind this.
There's two important variables regarding sword use: bSwordSheathed and bNoSword.
bNoSword is used by Disarm Tokens, and is toggled on the player and then all his doubles are set to what the player's bNoSword status.
bSwordSheathed is more general use, and it's set in a variety of circumstances. But normally for Player Doubles, it's set if they're standing on Oremites only.
On their turn, player doubles will use the subroutine SetSwordSheathed, which is primarily based around bSwordSheathed and whether to turn it on or off. Clones do the exact same things as Mimics do here... but they also check something more. They check if any of the following is true:
* The player is in a player role that does not carry a sword.
* The player has had bSwordOff set to true. This is based around the script command "Set player sword On/Off".
* The player currently has bNoSword (Disarm Token) set.
If any of the following is true, the clone will set its bSwordSheathed to true.
So what happens is that the Mimics haven't set bSwordSheathed (correctly, because they're not on Oremites), but the Clone has. Movement order then plays a factor here: your Mimic steps on the Disarm Token *after* the Clone has moved (and already called SetSwordSheathed). The Clone won't run that routine - and thus turn off its bSwordSheathed setting - until the next turn. But the Mimics were only using bNoSword, so their weapon comes back by the end of the turn.
Anyways, not sure how best to fix that, since the *underlying* cause is some confusion in variable use there. An easy fix would just be to recall SetSwordSheathed for all doubles in the SwordDisarm case in CDbRoom::ActivateToken, though.
EDIT: A better fix would probably revolve around moving some of those checks into HasSword, but I haven't verified that everything ideally checks the right things already. As stated, it's a confusing series of variables and functions, and it's going to take some work to pick it apart properly.
[Last edited by TFMurphy at 10-13-2007 10:54 PM]
|