From a11d32125f2083dc382ff398c0349af3699613e1 Mon Sep 17 00:00:00 2001 From: Jaka Kranjc Date: Thu, 18 Nov 2010 10:33:07 +0100 Subject: [PATCH] split out Actor::SetupFistData --- gemrb/core/Scriptable/Actor.cpp | 19 +++++++++++++------ gemrb/core/Scriptable/Actor.h | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index f65d57eff..b3a691981 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -6118,13 +6118,9 @@ void Actor::SetUsedHelmet(const char* AnimationType) } } -void Actor::SetupFist() +// initializes the fist data the first time it is called +void Actor::SetupFistData() { - int slot = core->QuerySlot( 0 ); - assert (core->QuerySlotEffects(slot)==SLOT_EFFECT_FIST); - int row = GetBase(fiststat); - int col = GetXPLevel(false); - if (FistRows<0) { FistRows=0; AutoTable fist("fistweap"); @@ -6143,9 +6139,20 @@ void Actor::SetupFist() } } } +} + +void Actor::SetupFist() +{ + int slot = core->QuerySlot( 0 ); + assert (core->QuerySlotEffects(slot)==SLOT_EFFECT_FIST); + int row = GetBase(fiststat); + int col = GetXPLevel(false); + if (col>MAX_LEVEL) col=MAX_LEVEL; if (col<1) col=1; + SetupFistData(); + const char *ItemResRef = DefaultFist; for (int i = 0;i