Skip to content

Commit

Permalink
fix asan detected bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoru committed Apr 17, 2024
1 parent 9902fbe commit 25feda9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/combat/weapons/g_weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick
int mask;
qboolean water;
int mod;
int iters = 0;

// calling entity made a sound, used to alert monsters
self->lastsound = level.framenum;
Expand All @@ -1384,7 +1385,7 @@ void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick
ignore = self;
water = false;
mask = MASK_SHOT|CONTENTS_SLIME|CONTENTS_LAVA;
while (ignore)
while (ignore && iters++ < 500)
{
tr = gi.trace (from, NULL, NULL, end, ignore, mask);

Expand Down

0 comments on commit 25feda9

Please sign in to comment.