summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/engine.cpp30
-rw-r--r--src/game.cpp19
3 files changed, 33 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 6550f5c6..71adf276 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-09-17 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/engine.cpp, src/game.cpp: Indent properly.
+
2005-09-17 Björn Steinbrink <B.Steinbrink@gmx.de>
* src/openglgraphics.cpp: Use gl{Push,Pop}Matrix instead of
@@ -15,7 +19,7 @@
src/gui/status.cpp, src/gui/trade.cpp, src/inventory.cpp,
src/net/messageout.cpp, src/net/network.cpp, src/net/network.h,
src/net/protocol.cpp, src/net/protocol.h: Completed transition to use
- MessageOut.
+ MessageOut.
2005-09-17 Yohann Ferreira <bertram@cegetel.net>
diff --git a/src/engine.cpp b/src/engine.cpp
index 73ee30b1..7642ef6c 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -314,13 +314,15 @@ void Engine::draw()
being->text_x = x + get_x_offset(being);
being->text_y = y + get_y_offset(being);
- if (being->action == Being::SIT || being->action == Being::DEAD) {
+ if (being->action == Being::SIT || being->action == Being::DEAD)
+ {
being->frame = 0;
}
frame = being->frame + being->action;
- if (being->action == Being::ATTACK) {
+ if (being->action == Being::ATTACK)
+ {
if (being->getWeapon() > 0)
frame += 4 * (being->getWeapon() - 1);
}
@@ -328,7 +330,8 @@ void Engine::draw()
graphics->drawImage(playerset->spriteset[frame + 16 * dir],
being->text_x - 16, being->text_y - 32);
- if (being->getWeapon() != 0 && being->action == Being::ATTACK) {
+ if (being->getWeapon() != 0 && being->action == Being::ATTACK)
+ {
Image *image = weaponset->spriteset[
16 * (being->getWeapon() - 1) + 4 * being->frame + dir];
@@ -336,7 +339,8 @@ void Engine::draw()
being->text_x - 64, being->text_y - 80);
}
- if (being->getHairColor() <= NR_HAIR_COLORS) {
+ if (being->getHairColor() <= NR_HAIR_COLORS)
+ {
int hf = being->getHairColor() - 1 + 10 * (dir + 4 *
(being->getHairStyle() - 1));
@@ -345,25 +349,27 @@ void Engine::draw()
being->text_y - 50 + 2 * hairtable[frame][dir][1]);
}
- if (being->emotion != 0) {
+ if (being->emotion != 0)
+ {
graphics->drawImage(
emotionset->spriteset[being->emotion - 1],
being->text_x + 3, being->text_y - 90);
}
- if (being != player_node) {
- graphics->setFont(speechFont);
- graphics->drawText(being->getName(),
- being->text_x + 15, being->text_y + 30,
- gcn::Graphics::CENTER);
- graphics->setFont(gui->getFont());
+ if (being != player_node)
+ {
+ graphics->setFont(speechFont);
+ graphics->drawText(being->getName(),
+ being->text_x + 15, being->text_y + 30,
+ gcn::Graphics::CENTER);
+ graphics->setFont(gui->getFont());
}
break;
// Draw a NPC
case Being::NPC:
graphics->drawImage(npcset->spriteset[being->job - 100],
- x - 8, y - 52);
+ x - 8, y - 52);
break;
// Draw a monster
diff --git a/src/game.cpp b/src/game.cpp
index 31b82b67..f2f86064 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -666,15 +666,16 @@ void do_input()
{
// Player default: trade
case Being::PLAYER:
- {
- if (target != player_node) {
- MessageOut outMsg;
- outMsg.writeShort(0x00e4);
- outMsg.writeLong(target->getId());
- writeSet(6);
- tradePartnerName = target->getName();
+ {
+ if (target != player_node)
+ {
+ MessageOut outMsg;
+ outMsg.writeShort(CMSG_TRADE_REQUEST);
+ outMsg.writeLong(target->getId());
+ writeSet(6);
+ tradePartnerName = target->getName();
+ }
}
- }
break;
// NPC default: talk
@@ -682,7 +683,7 @@ void do_input()
if (!current_npc)
{
MessageOut outMsg;
- outMsg.writeShort(0x0090);
+ outMsg.writeShort(CMSG_NPC_TALK);
outMsg.writeLong(target->getId());
outMsg.writeByte(0);
writeSet(7);