diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-22 12:42:35 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-22 12:42:35 +0000 |
commit | 1d64b7a037435aee796f068770a0c2ca2b19a93a (patch) | |
tree | e211c9da2b6a4303df5717a3ddf2ed16736f3a76 /src/game.cpp | |
parent | c3628bdf27c92cd7b339393e7472f9528c8a1c5c (diff) | |
download | mana-1d64b7a037435aee796f068770a0c2ca2b19a93a.tar.gz mana-1d64b7a037435aee796f068770a0c2ca2b19a93a.tar.bz2 mana-1d64b7a037435aee796f068770a0c2ca2b19a93a.tar.xz mana-1d64b7a037435aee796f068770a0c2ca2b19a93a.zip |
Detect ghosts at creation time.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index ce269bfa..dd7eccdb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -724,17 +724,28 @@ void do_parse() // Add new being / stop monster case 0x0078: - being = findNode(RFIFOL(2)); + int id = RFIFOL(2); + int job = RFIFOW(14); - if (being == NULL) { + // Being with id >= 110000000 and job 0 are better known + // as ghosts, so don't create those. + if (job == 0 && id >= 110000000) + { + break; + } + + being = findNode(id); + + if (being == NULL) + { being = new Being(); - being->id = RFIFOL(2); + being->id = id; being->speed = RFIFOW(6); if (being->speed == 0) { // Else division by 0 when calculating frame being->speed = 150; } - being->job = RFIFOW(14); + being->job = job; being->setHairStyle(RFIFOW(16)); being->setHairColor(RFIFOW(28)); being->x = get_x(RFIFOP(46)); @@ -742,7 +753,8 @@ void do_parse() being->direction = get_direction(RFIFOP(46)); add_node(being); } - else { + else + { being->clearPath(); being->x = get_x(RFIFOP(46)); being->y = get_y(RFIFOP(46)); |