summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 16:20:15 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 16:20:15 +0000
commitea6011fbc06a2adc9805baabf8c921b48f60f2c3 (patch)
treecba2d0c6d1f8f1b6a46e248fb031e97c12693c10 /src/game.cpp
parent49949e95f8fed59ee815ef36a03c54a6959996db (diff)
downloadmana-ea6011fbc06a2adc9805baabf8c921b48f60f2c3.tar.gz
mana-ea6011fbc06a2adc9805baabf8c921b48f60f2c3.tar.bz2
mana-ea6011fbc06a2adc9805baabf8c921b48f60f2c3.tar.xz
mana-ea6011fbc06a2adc9805baabf8c921b48f60f2c3.zip
Maybe now finally no more crashing in paths? Needs playtesting, I know we all
like that!
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 9d55b3e4..c9d611bf 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -537,15 +537,17 @@ void do_parse() {
break;
// Add new being / stop monster
case 0x0078:
- if (find_node(RFIFOL(2)) == NULL) {
+ being = find_node(RFIFOL(2));
+
+ if (being == NULL) {
being = new Being();
being->id = RFIFOL(2);
being->speed = RFIFOW(6);
if (being->speed == 0) {
- being->speed = 150; // Else division by 0 when calculating frame
+ // Else division by 0 when calculating frame
+ being->speed = 150;
}
being->job = RFIFOW(14);
- being->clearPath();
being->x = get_x(RFIFOP(46));
being->y = get_y(RFIFOP(46));
being->direction = get_direction(RFIFOP(46));
@@ -554,15 +556,13 @@ void do_parse() {
add_node(being);
}
else {
- if (being) {
- being->clearPath();
- being->x = get_x(RFIFOP(46));
- being->y = get_y(RFIFOP(46));
- being->direction = get_direction(RFIFOP(46));
- being->frame = 0;
- being->walk_time = tick_time;
- being->action = STAND;
- }
+ being->clearPath();
+ being->x = get_x(RFIFOP(46));
+ being->y = get_y(RFIFOP(46));
+ being->direction = get_direction(RFIFOP(46));
+ being->frame = 0;
+ being->walk_time = tick_time;
+ being->action = STAND;
}
break;