Permalink
Browse files

Merge pull request #1294 from mugmuggy/somefixes

[RDY] Entity map and cpp fixes
  • Loading branch information...
TheCycoONE committed Nov 29, 2017
2 parents 7c8fdab + c794f7c commit 7f52d8e45c9049045540af35f67ecd2250ee0096
Showing with 3 additions and 4 deletions.
  1. +2 −2 CorsixTH/Lua/entity_map.lua
  2. +1 −1 CorsixTH/Src/lua.hpp
  3. +0 −1 CorsixTH/Src/th_lua_map.cpp
@@ -186,8 +186,8 @@ function EntityMap:getAdjacentFreeTiles(x, y)
local x_coord = coord['x']
local y_coord = coord['y']
-- If no object or humanoid occupy the til_coorde
if self:getHumanoidsAtCoordinate(x_coord, y_coord) == nil and
self:getObjectsAtCoordinate(x_coord, y_coord) == nil then
if #self:getHumanoidsAtCoordinate(x_coord, y_coord) == 0 and
#self:getObjectsAtCoordinate(x_coord, y_coord) == 0 then
adjacent_free_tiles[#adjacent_free_tiles+1] = coord
end
end
View
@@ -51,7 +51,7 @@ inline int lua_equal(lua_State *L, int idx1, int idx2)
#ifndef lua_lessthan
inline int lua_lessthan(lua_State *L, int idx1, int idx2)
{
return lua_compare(L, idx1, idx1, LUA_OPLT);
return lua_compare(L, idx1, idx2, LUA_OPLT);
}
#endif
@@ -412,7 +412,6 @@ static int l_map_get_player_heliport(lua_State *L)
int iX, iY;
int iPlayer = static_cast<int>(luaL_optinteger(L, 2, 1));
bool bGood = pMap->getPlayerHeliportTile(iPlayer - 1, &iX, &iY);
bGood = pMap->getPlayerHeliportTile(iPlayer - 1, &iX, &iY);
if(!bGood)
return luaL_error(L, "Player index out of range: %d", iPlayer);
lua_pushinteger(L, iX + 1);

0 comments on commit 7f52d8e

Please sign in to comment.