Hi everybody,
I am writing the code for handling zombies, which is quite simple.
I was just wondering what is the right way to check in game states that the active player is zombie or not (and not executing some code if he is).
Currently, I use this
Can I replace that with
Considering that "Current" methods normally refer to the player who have sent the request? I don't know what that mean when a player is zombie, since he does not send any more request to the server... Does that filter active zombie as well?
Thanks very much for your advice
Tchebychev
I am writing the code for handling zombies, which is quite simple.
I was just wondering what is the right way to check in game states that the active player is zombie or not (and not executing some code if he is).
Currently, I use this
Code: Select all
self::isZombie(self::getActivePlayerId()) // true if the active player is zombie, else false
function isZombie($player_id) {
return self::getUniqueValueFromDB("SELECT player_zombie FROM player WHERE player_id=".$player_id);
}
Code: Select all
self::isCurrentPlayerZombie// true if the active player is zombie, else false
Thanks very much for your advice
Tchebychev