Working on Portals, related questions
#43
Wonderful. I updated from r856 (yeah, it's been a while) to r1017. Guess what? Portals are broken. And I have NO IDEA why, because this code:
Code:
Player:SendMessage("SOME YOUR PORTAL STATE BELONG TO US! "..PlayersData[_name].portal_state)
if (PlayersData[_name].portal_state == -1) then
    Player:SendMessage("ALL YOUR PORTAL STATE BELONG TO US! "..PlayersData[_name].portal_state)
    Player:SendMessage("Stand still for "..PORTAL_ACTIVATION_TIME.." seconds for teleportation")
    PlayersData[_name].portal_state = 1
end
result is in-game chat message with "SOME YOUR PORTAL STATE BELONG TO US! -1", and nothing else happens (teleportation and two more messages should!).
So, somehow if (PlayersData[_name].portal_state == -1) then is not a valid statement. Although it is. As it should be. But it isn't.
Using == "-1" helped, but make whole code somewhat messy. tonumber() had no effect.

Any ideas on why the f*ck did it happened?
Reply
Thanks given by:


Messages In This Thread
RE: Working on Portals, related questions - by Taugeshtu - 11-03-2012, 01:03 AM



Users browsing this thread: 12 Guest(s)