diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-13 21:33:02 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-13 21:33:02 +0000 |
commit | a68d11c8f32ac8795a27fe3bc27e1943ee6dc813 (patch) | |
tree | 09576a6d6bb87ce2fd2b2a1e577a4b8e9ee5d5ea /src/game.cpp | |
parent | a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9 (diff) | |
download | mana-a68d11c8f32ac8795a27fe3bc27e1943ee6dc813.tar.gz mana-a68d11c8f32ac8795a27fe3bc27e1943ee6dc813.tar.bz2 mana-a68d11c8f32ac8795a27fe3bc27e1943ee6dc813.tar.xz mana-a68d11c8f32ac8795a27fe3bc27e1943ee6dc813.zip |
Merge createBeing and add_node.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/game.cpp b/src/game.cpp index bfabc528..54f900b1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -172,17 +172,6 @@ int get_elapsed_time(int start_time) } } -Being* createBeing(unsigned int id, unsigned short job, Map *map) -{ - Being *being = new Being; - - being->setId(id); - being->job = job; - being->setMap(map); - - return being; -} - /** * Create all the various globally accessible gui windows */ @@ -318,8 +307,6 @@ void do_init() player_node->setWeapon(char_info->weapon); - add_node(player_node); - remove("packet.list"); // Initialize joypad @@ -1066,7 +1053,6 @@ void do_parse() being->setHairColor(RFIFOW(28)); being->setWeapon(RFIFOW(18)); being->setMap(tiledMap); - add_node(being); } else { @@ -1120,7 +1106,6 @@ void do_parse() if (being == NULL) { being = createBeing(RFIFOL(2), RFIFOW(14), tiledMap); - add_node(being); } being->speed = RFIFOW(6); @@ -1147,7 +1132,6 @@ void do_parse() if (being == NULL) { being = createBeing(RFIFOL(2), RFIFOW(14), tiledMap); - add_node(being); } being->action = Being::STAND; @@ -1167,7 +1151,6 @@ void do_parse() if (being == NULL) { being = createBeing(RFIFOL(2), RFIFOW(14), tiledMap); - add_node(being); } being->speed = RFIFOW(6); @@ -1378,20 +1361,20 @@ void do_parse() { empty_floor_items(); + // Remove the player, so it is not deleted + beings.remove(player_node); + // Delete all beings except the local player std::list<Being *>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { - if ((*i) != player_node) - { - delete (*i); - } + delete (*i); } beings.clear(); autoTarget = NULL; // Re-add the local player node - add_node(player_node); + beings.push_back(player_node); player_node->action = Being::STAND; player_node->frame = 0; |