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/crnonpl.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/crnonpl.cc') diff --git a/src/crnonpl.cc b/src/crnonpl.cc index 2e56f66..c425b02 100644 --- a/src/crnonpl.cc +++ b/src/crnonpl.cc @@ -324,7 +324,7 @@ TBehaviourDatabase::TBehaviourDatabase(TReadScriptFile *Script) : Script->nextToken(); TBehaviourNode *Right = this->readTerm(Script); Behaviour->addCondition(BEHAVIOUR_CONDITION_EXPRESSION, - NewBehaviourNode(Operator, Right, Left)); + NewBehaviourNode(Operator, Left, Right)); }else{ Script->nextToken(); } @@ -1393,12 +1393,15 @@ void LoadMonsterhomes(void){ } void ProcessMonsterhomes(void){ - for(int i = 0; i < Monsterhomes; i += 1){ + for(int i = 1; i <= Monsterhomes; i += 1){ TMonsterhome *MH = Monsterhome.at(i); - if(MH->Timer > 0){ - MH->Timer -= 1; + + ASSERT(MH->Timer >= 0); + if(MH->Timer == 0){ + continue; } + MH->Timer -= 1; if(MH->Timer > 0){ continue; } -- cgit v1.2.3