Skip to content

Commit

Permalink
KOTOR2: Change Creature::createPC() to take a reference, not a pointer
Browse files Browse the repository at this point in the history
It needs a CharacterGenerationInfo, which can't be 0.
  • Loading branch information
DrMcCoy committed May 15, 2018
1 parent 72d529b commit 4ac25e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/engines/kotor2/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ void Creature::createFakePC() {
_isPC = true;
}

void Creature::createPC(const CharacterGenerationInfo *info) {
_name = info->getName();
void Creature::createPC(const CharacterGenerationInfo &info) {
_name = info.getName();
_isPC = true;

PartModels parts;

parts.body = info->getBodyId();
parts.bodyTexture = info->getBodyTextureId();
parts.head = info->getHeadId();
parts.body = info.getBodyId();
parts.bodyTexture = info.getBodyTextureId();
parts.head = info.getHeadId();

loadBody(parts);
loadHead(parts);
Expand Down
2 changes: 1 addition & 1 deletion src/engines/kotor2/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Creature : public Object {
/** Create a fake player character creature for testing purposes. */
void createFakePC();
/** Create a player character creature. */
void createPC(const CharacterGenerationInfo *info);
void createPC(const CharacterGenerationInfo &info);

// Basic visuals

Expand Down
2 changes: 1 addition & 1 deletion src/engines/kotor2/gui/chargen/chargeninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Common::UString CharacterGenerationInfo::getPortrait() const {
Creature *CharacterGenerationInfo::getCharacter() const {
Common::ScopedPtr<Creature> creature(new Creature());

creature->createPC(this);
creature->createPC(*this);
return creature.release();
}

Expand Down

0 comments on commit 4ac25e4

Please sign in to comment.