ROGUE_MAXTOTAL = strength*2, ISMANY -> 1
This commit is contained in:
@@ -22,6 +22,13 @@
|
||||
*/
|
||||
void rogue_restoreobject(THING *o,struct rogue_packitem *item);
|
||||
|
||||
int32_t rogue_total(THING *o)
|
||||
{
|
||||
if ( (o->o_flags & ISMANY) != 0 )
|
||||
return(1);
|
||||
else return(o->o_count);
|
||||
}
|
||||
|
||||
void restore_player(struct rogue_state *rs)
|
||||
{
|
||||
int32_t i,total = 0; THING *obj;
|
||||
@@ -38,8 +45,8 @@ void restore_player(struct rogue_state *rs)
|
||||
{
|
||||
obj = new_item();
|
||||
rogue_restoreobject(obj,&rs->P.roguepack[i]);
|
||||
total += obj->o_count;
|
||||
if ( total > pstats.s_str*3 )
|
||||
total += rogue_total(obj);
|
||||
if ( total > ROGUE_MAXTOTAL )
|
||||
break;
|
||||
add_pack(rs,obj,TRUE);
|
||||
}
|
||||
|
||||
@@ -166,16 +166,16 @@ int32_t num_packitems(struct rogue_state *rs)
|
||||
if ( list->o_packch != 0 )
|
||||
{
|
||||
n++;
|
||||
total += list->o_count;
|
||||
total += rogue_total(list);
|
||||
}
|
||||
}
|
||||
if ( rs->guiflag != 0 )
|
||||
{
|
||||
char str[MAXSTR];
|
||||
sprintf(str,"strength*3 %d vs total.%d vs %d inventory letters\n",pstats.s_str*3,total,n);
|
||||
sprintf(str,"strength*2 %d vs total.%d vs %d inventory letters\n",ROGUE_MAXTOTAL,total,n);
|
||||
add_line(rs,"%s",str);
|
||||
}
|
||||
if ( total > pstats.s_str*3 )
|
||||
if ( total > ROGUE_MAXTOTAL )
|
||||
return(MAXPACK);
|
||||
return(n);
|
||||
}
|
||||
|
||||
@@ -381,6 +381,9 @@ void restore_player(struct rogue_state *rs);
|
||||
int32_t rogue_replay2(uint8_t *newdata,uint64_t seed,char *keystrokes,int32_t num,struct rogue_player *player,int32_t sleepmillis);
|
||||
void rogue_bailout(struct rogue_state *rs);
|
||||
|
||||
#define ROGUE_MAXTOTAL (pstats.s_str*2)
|
||||
int32_t rogue_total(THING *o);
|
||||
|
||||
/*
|
||||
* Help list
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user