summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp14
-rw-r--r--src/being.h2
-rw-r--r--src/game.cpp2
3 files changed, 5 insertions, 13 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 579ad54f..2bb0beff 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -91,18 +91,10 @@ Being* createBeing(unsigned int id, unsigned short job, Map *map)
return being;
}
-void remove_node(unsigned int id)
+void remove_node(Being *being)
{
- std::list<Being *>::iterator i;
- for (i = beings.begin(); i != beings.end(); i++)
- {
- if ((*i)->getId() == id)
- {
- delete (*i);
- beings.erase(i);
- return;
- }
- }
+ delete being;
+ beings.remove(being);
}
Being *findNode(unsigned int id)
diff --git a/src/being.h b/src/being.h
index 3b9e0d93..2a9a8421 100644
--- a/src/being.h
+++ b/src/being.h
@@ -245,7 +245,7 @@ Being *findNode(unsigned short x, unsigned short y, Being::Type type);
Being *createBeing(unsigned int id, unsigned short job, Map *map);
/** Remove a Being */
-void remove_node(unsigned int id);
+void remove_node(Being *being);
/** Find a NPC id based on its coordinates */
unsigned int findNpc(unsigned short x, unsigned short y);
diff --git a/src/game.cpp b/src/game.cpp
index 54f900b1..c2620742 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1089,7 +1089,7 @@ void do_parse()
//remove_node(RFIFOL(2));
}
else {
- remove_node(RFIFOL(2));
+ remove_node(being);
}
if (being == autoTarget) {