summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-09-17 14:25:03 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-09-17 14:25:03 +0000
commit7d7ea134637eb06e194068f157d3eead90115631 (patch)
tree9ea5d90f07531d0c71f2dd8adf3a6ec956f2dffa /src
parent02e54bb74d2032abfbbdb17dc14d8d85664deb40 (diff)
downloadmana-7d7ea134637eb06e194068f157d3eead90115631.tar.gz
mana-7d7ea134637eb06e194068f157d3eead90115631.tar.bz2
mana-7d7ea134637eb06e194068f157d3eead90115631.tar.xz
mana-7d7ea134637eb06e194068f157d3eead90115631.zip
Indent properly.
Diffstat (limited to 'src')
-rw-r--r--src/engine.cpp30
-rw-r--r--src/game.cpp19
2 files changed, 28 insertions, 21 deletions
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);