Skip to content

Commit

Permalink
Preserve player_race across chained changes to the shape
Browse files Browse the repository at this point in the history
May resolve #426 .
  • Loading branch information
backwardsEric authored and NickMcConnell committed Jun 12, 2024
1 parent ec2db66 commit bfa0a54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mon-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,9 +1734,12 @@ bool monster_change_shape(struct monster *mon)

/* Set the race */
if (race) {
if (!mon->original_race) mon->original_race = mon->race;
if (!mon->original_race) {
mon->original_race = mon->race;
assert(!mon->original_player_race);
mon->original_player_race = mon->player_race;
}
mon->race = race;
mon->original_player_race = mon->player_race;
if (rf_has(race->flags, RF_PLAYER)) {
mon->player_race = get_player_race();
} else {
Expand Down

0 comments on commit bfa0a54

Please sign in to comment.