summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-14 01:02:46 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-14 01:02:46 +0000
commit7fe28c4550c2ae82b796ebd2d05a9dcac1f9e384 (patch)
tree26d02901189875ae8766354ac8930f4733640641 /src/game.cpp
parent486c57304076b7352a588dff08c2b976a76e1608 (diff)
downloadmana-7fe28c4550c2ae82b796ebd2d05a9dcac1f9e384.tar.gz
mana-7fe28c4550c2ae82b796ebd2d05a9dcac1f9e384.tar.bz2
mana-7fe28c4550c2ae82b796ebd2d05a9dcac1f9e384.tar.xz
mana-7fe28c4550c2ae82b796ebd2d05a9dcac1f9e384.zip
Made Being::setDamage accept a short instead of a string.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b3801bfd..2fb79ef7 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -23,8 +23,6 @@
#include "game.h"
-#include <sstream>
-
#include <guichan/sdl/sdlinput.hpp>
#include "being.h"
@@ -1564,28 +1562,21 @@ void do_parse()
{
Being *srcBeing = findNode(msg.readLong());
Being *dstBeing = findNode(msg.readLong());
- msg.readLong(); // server tick
- msg.readLong(); // src speed
- msg.readLong(); // dst speed
+// msg.readLong(); // server tick
+// msg.readLong(); // src speed
+// msg.readLong(); // dst speed
+ msg.skip(12);
short param1 = msg.readShort();
- msg.readShort(); // param 2
+ msg.skip(2); // param 2
char type = msg.readByte();
- msg.readShort(); // param 3
+ msg.skip(2); // param 3
switch (type)
{
case 0: // Damage
if (dstBeing == NULL) break;
- if (param1 == 0) {
- // Yellow
- dstBeing->setDamage("miss", SPEECH_TIME);
- } else {
- // Blue for monster, red for player
- std::stringstream ss;
- ss << param1;
- dstBeing->setDamage(ss.str(), SPEECH_TIME);
- }
+ dstBeing->setDamage(param1, SPEECH_TIME);
if (srcBeing != NULL &&
srcBeing != player_node)
@@ -1594,7 +1585,6 @@ void do_parse()
srcBeing->action = Being::ATTACK;
srcBeing->frame = 0;
srcBeing->walk_time = tick_time;
- srcBeing->frame = 0;
}
break;