aboutsummaryrefslogtreecommitdiff
path: root/src/magic.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/magic.cc')
-rw-r--r--src/magic.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/magic.cc b/src/magic.cc
index 0f36bee..a47c730 100644
--- a/src/magic.cc
+++ b/src/magic.cc
@@ -814,7 +814,7 @@ void MassCombat(TCreature *Actor, Object Target, int ManaPoints, int SoulPoints,
throw ERROR;
}
- if(Actor != NULL){
+ if(Actor == NULL){
error("MassCombat: Übergebene Kreatur existiert nicht.\n");
throw ERROR;
}
@@ -4060,8 +4060,8 @@ void UseMagicItem(uint32 CreatureID, Object Obj, Object Dest){
if(Other.getObjectType().isCreatureContainer()){
uint32 OtherID = Other.getCreatureID();
if(Target == NULL
- || (Aggressive && OtherID != Actor->ID)
- || (!Aggressive && OtherID == Actor->ID)){
+ || (Aggressive && OtherID != Actor->ID && OtherID != Target->ID)
+ || (!Aggressive && OtherID == Actor->ID && OtherID != Target->ID)){
Target = GetCreature(OtherID);
Dest = Other;
}
@@ -4086,7 +4086,7 @@ void UseMagicItem(uint32 CreatureID, Object Obj, Object Dest){
throw PROTECTIONZONE;
}
- if(Dest.getContainer().getObjectType().isMapContainer()){
+ if(!Dest.getContainer().getObjectType().isMapContainer()){
throw NOROOM;
}
}