fix crashes

This commit is contained in:
Ondrej Novak 2025-02-16 20:41:29 +01:00
parent 04ab5898ef
commit a8c9fced4c
12 changed files with 65 additions and 59 deletions

View file

@ -544,7 +544,8 @@ void play_sample_at_sector(int sample,int listener,int source,int track, char lo
int oldtrack;
if (!sound_enabled) return;
if (map_coord[listener].layer!=map_coord[source].layer) return;
if (listener<0 || listener>=mapsize || map_coord[listener].layer!=map_coord[source].layer) return;
if (source<0 || source >=mapsize) return;
xd=map_coord[source].x;
yd=map_coord[source].y;
chan=find_free_channel(track);