diff options
-rw-r--r-- | src/game-server/command.cpp | 4 | ||||
-rw-r--r-- | src/game-server/commandhandler.cpp | 4 | ||||
-rw-r--r-- | src/game-server/state.cpp | 4 | ||||
-rw-r--r-- | src/game-server/state.h | 2 | ||||
-rw-r--r-- | src/scripting/lua.cpp | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/game-server/command.cpp b/src/game-server/command.cpp index d47bb889..dc824b2c 100644 --- a/src/game-server/command.cpp +++ b/src/game-server/command.cpp @@ -196,7 +196,7 @@ static void drop(Character *from, ItemClass *it, int nb) Item *item = new Item(it, nb); item->setMap(from->getMap()); item->setPosition(from->getPosition()); - GameState::insertSafe(item); + GameState::insertOrDelete(item); } static void spawn(Character *from, MonsterClass *specy, int nb) @@ -210,7 +210,7 @@ static void spawn(Character *from, MonsterClass *specy, int nb) monster->setMap(map); monster->setPosition(pos); monster->clearDestination(); - if (!GameState::insertSafe(monster)) + if (!GameState::insertOrDelete(monster)) { // The map is full. Break out. break; diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp index 09016214..f01e8540 100644 --- a/src/game-server/commandhandler.cpp +++ b/src/game-server/commandhandler.cpp @@ -568,7 +568,7 @@ static void handleDrop(Character *player, std::string &args) Item *item = new Item(ic, value); item->setMap(player->getMap()); item->setPosition(player->getPosition()); - GameState::insertSafe(item); + GameState::insertOrDelete(item); // log transaction std::stringstream str; @@ -681,7 +681,7 @@ static void handleSpawn(Character *player, std::string &args) monster->setMap(map); monster->setPosition(pos); monster->clearDestination(); - if (!GameState::insertSafe(monster)) + if (!GameState::insertOrDelete(monster)) { // The map is full. Break out. break; diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index 5cd15881..5ad0c579 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -508,7 +508,7 @@ void GameState::update(int worldTime) break; case EVENT_INSERT: - insertSafe(o); + insertOrDelete(o); break; case EVENT_WARP: @@ -611,7 +611,7 @@ bool GameState::insert(Thing *ptr) return true; } -bool GameState::insertSafe(Thing *ptr) +bool GameState::insertOrDelete(Thing *ptr) { if (insert(ptr)) return true; delete ptr; diff --git a/src/game-server/state.h b/src/game-server/state.h index ff945a8a..479cc1d9 100644 --- a/src/game-server/state.h +++ b/src/game-server/state.h @@ -53,7 +53,7 @@ namespace GameState * @return false if the insertion failed. * @note No update may be in progress. Invalid for characters. */ - bool insertSafe(Thing *); + bool insertOrDelete(Thing *); /** * Removes a thing from the game world. diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 70afc933..6f36bb95 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -1743,7 +1743,7 @@ static int item_drop(lua_State *s) i->setMap(map); Point pos(x, y); i->setPosition(pos); - GameState::insertSafe(i); + GameState::insertOrDelete(i); return 0; } |