Error checking in GetThisPlayer
This commit is contained in:
parent
35c7455ab5
commit
5f3cc5e2d5
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue