View Single Post
Old May 14, 2014, 13:14   #1
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,786
PowerWyrm is on a distinguished road
[3.5] Turn count bug (player history)

Playing the v3.5 competition character, I've found that each time you save the game, the turn count is reset in the player history screen.

Seems related to the fact that p_ptr->total_energy / 100 is stored in the turn count now instead of the actual turn.

In load.c (rd_history):

Code:
		rd_u16b(&type);
		rd_s32b(&turnno);
		rd_s16b(&dlev);
		rd_s16b(&clev);
		rd_byte(&art_name);
		rd_string(text, sizeof(text));
		
		history_add_full(type, &a_info[art_name], dlev, clev, turnno, text);
In history.c (history_add_full):

Code:
history_list[history_ctr].turn = p_ptr->total_energy / 100;
In history.c (history_add):

Code:
return history_add_full(type, artifact, p_ptr->depth, p_ptr->lev, turn, event);
I don't see why the "turnno" parameter is not used. The fix should be pretty trivial:

- in history.c (history_add_full):

Code:
history_list[history_ctr].turn = turnno;
- in history.c (history_add):

Code:
return history_add_full(type, artifact, p_ptr->depth, p_ptr->lev, p_ptr->total_energy / 100, event);
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote