From e4b8bf807b76f6f446d9617d9a3957dc77dd6e90 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Mon, 21 Jul 2025 19:23:42 -0300 Subject: multiple bug-fixes and improvements - Make uint32 -> Object conversion explicit. This can be more verbose but will get a lot of small mistakes, especially with function overloads. - Fix problem with the path finder not including the last step when `MustReach` was false. - Fix problem with NPC conditions. - Fix problem with monster homes continuously spawning monsters. - Fix problem with creating the standard inventory. - Fix problem with creature timers (IMPORTANT). - Fix problem with `ThrowPossible` (IMPORTANT). - Fix problem with rune casting. - Fix problem with executing moveuse events. - Fix problem with `MoveRel` and `WriteName` moveuse actions. - Fix problem with eating food deleting the whole stack. - Many other bug-fixes and improvements. --- src/magic.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/magic.cc') 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; } } -- cgit v1.2.3