SAGA2: Fix Actor void initialization

This commit is contained in:
a/ 2021-06-19 16:06:54 +09:00 committed by Eugene Sandulenko
parent 4f363da243
commit a532e97f3e
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 55 additions and 1 deletions

View File

@ -1061,6 +1061,60 @@ void Actor::init(
// Actor constructor -- copies the resource fields and simply NULL's most
// of the rest of the data members
Actor::Actor(void) {
prototype = nullptr;
faction = 0;
colorScheme = 0;
appearanceID = 0;
attitude = 0;
mood = 0;
disposition = 0;
currentFacing = 0;
tetherLocU = 0;
tetherLocV = 0;
tetherDist = 0;
leftHandObject = 0;
rightHandObject = 0;
schedule = 0;
for (int i = 0; i < 16; ++i)
knowledge[i] = 0;
// Initialize the rest of the data members
for (int i = 0; i < 4; ++i)
conversationMemory[i] = 0;
currentAnimation = actionStand;
currentPose = 0;
animationFlags = 0;
flags = 0;
memset(&poseInfo, 0, sizeof(poseInfo));
appearance = nullptr;
cycleCount = 0;
kludgeCount = 0;
moveTask = nullptr;
enchantmentFlags = 0L;
curTask = nullptr;
currentGoal = actorGoalFollowAssignment;
deactivationCounter = 0;
_assignment = nullptr;
memset(&effectiveStats, 0, sizeof(effectiveStats));
effectiveStats.vitality = MAX<uint16>(effectiveStats.vitality, 1);
actionCounter = 0;
effectiveResistance = 0;
effectiveImmunity = 0;
recPointsPerUpdate = BASE_REC_RATE;
currentRecoveryPoints = 0;
leader = nullptr;
followers = nullptr;
for (int i = 0; i < ARMOR_COUNT; i++)
armorObjects[i] = Nothing;
currentTarget = nullptr;
for (int i = 0; i < actorScriptVars; i++)
scriptVar[i] = 0;
}
Actor::Actor(const ResourceActor &res) : GameObject(res) {
int i;

View File

@ -654,7 +654,7 @@ private:
public:
// Default constructor
Actor(void) {}
Actor(void);
// Constructor - initial actor construction
Actor(const ResourceActor &res);