summaryrefslogtreecommitdiff
path: root/src/game-server/state.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-09-27 17:14:12 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-09-27 17:14:12 +0200
commit1847d5ac2a5a93fa66d1b98a986ca7072a86037e (patch)
treec23f2da6ee1f14554a70849e54d961f029377590 /src/game-server/state.cpp
parentb2bbb73f3fab10b238a61bf3aa185d80e6d2070f (diff)
downloadmanaserv-1847d5ac2a5a93fa66d1b98a986ca7072a86037e.tar.gz
manaserv-1847d5ac2a5a93fa66d1b98a986ca7072a86037e.tar.bz2
manaserv-1847d5ac2a5a93fa66d1b98a986ca7072a86037e.tar.xz
manaserv-1847d5ac2a5a93fa66d1b98a986ca7072a86037e.zip
Added script bindings and netcode for creating being-bound effects.
Diffstat (limited to 'src/game-server/state.cpp')
-rw-r--r--src/game-server/state.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index dcfb9139..faca3c1a 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -400,11 +400,20 @@ static void informPlayer(MapComposite *map, Character *p)
// Don't show old effects
if (!(oflags & UPDATEFLAG_NEW_ON_MAP))
break;
- MessageOut effectMsg(GPMSG_CREATE_EFFECT);
- effectMsg.writeShort(o->getEffectId());
- effectMsg.writeShort(opos.x);
- effectMsg.writeShort(opos.y);
- gameHandler->sendTo(p, effectMsg);
+ Being *b = o->getBeing();
+ if (b)
+ {
+ MessageOut effectMsg(GPMSG_CREATE_EFFECT_BEING);
+ effectMsg.writeShort(o->getEffectId());
+ effectMsg.writeShort(b->getPublicID());
+ gameHandler->sendTo(p, effectMsg);
+ } else {
+ MessageOut effectMsg(GPMSG_CREATE_EFFECT_POS);
+ effectMsg.writeShort(o->getEffectId());
+ effectMsg.writeShort(opos.x);
+ effectMsg.writeShort(opos.y);
+ gameHandler->sendTo(p, effectMsg);
+ }
}
break;
default: break;