Error checking in GetThisPlayer

This commit is contained in:
jsalmon3 2004-10-17 16:03:47 +00:00
parent 35c7455ab5
commit 5f3cc5e2d5

View file

@ -407,7 +407,11 @@ static int CclGetThisPlayer(lua_State* l)
if (lua_gettop(l) != 0) {
LuaError(l, "incorrect argument");
}
lua_pushnumber(l, ThisPlayer - Players);
if (ThisPlayer) {
lua_pushnumber(l, ThisPlayer - Players);
} else {
lua_pushnumber(l, 0);
}
return 1;
}