mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-15 02:36:40 -04:00
fix memory leak in restore_items
This commit is contained in:
parent
1297cccd70
commit
66aaaeaf50
2 changed files with 9 additions and 8 deletions
|
@ -231,6 +231,7 @@ void restore_items(TMPFILE_RD *f)
|
|||
|
||||
for(i=0;i<mapsize*4;i++) if (map_items[i]!=NULL) free(map_items[i]);
|
||||
memset(map_items,0,mapsize*4*sizeof(*map_items));
|
||||
free(map_items);
|
||||
map_items = new_item_map;
|
||||
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ int vypocet_zasahu(const short *utocnik,const short *obrance, int chaos,int zbr
|
|||
int ospod;
|
||||
int attack_roll,defense_roll,mag_att_roll,mg_def;
|
||||
int dmzhit = 0;
|
||||
int ddostal = 0;
|
||||
// int ddostal = 0;
|
||||
int disadv = 0;
|
||||
int obrbonus = obrance[VLS_OBRAT]/5;
|
||||
int magbonus = utocnik[VLS_SMAGIE]/5;
|
||||
|
@ -424,7 +424,7 @@ int vypocet_zasahu(const short *utocnik,const short *obrance, int chaos,int zbr
|
|||
if (zasah<0) zasah=0;
|
||||
int damage = utocnik[VLS_DAMAGE]+zbran;
|
||||
if (zasah<=0 || damage<=0) damage = 0;
|
||||
ddostal=zasah;
|
||||
// ddostal=zasah;
|
||||
zasah+=damage;
|
||||
if (log_combat) {
|
||||
wzprintf(">");
|
||||
|
@ -457,7 +457,7 @@ int vypocet_zasahu(const short *utocnik,const short *obrance, int chaos,int zbr
|
|||
int tmp = zasah;
|
||||
zasah/=2;
|
||||
if (log_combat) wzprintf( "Physical resistance applied: %d - %d (half)= %d\n", tmp,tmp - zasah, zasah);
|
||||
ddostal = zasah;
|
||||
// ddostal = zasah;
|
||||
}
|
||||
int total_hit = zasah+dmzhit;
|
||||
if (log_combat) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue