diff --git a/source/games/whaven/src/ai.cpp b/source/games/whaven/src/ai.cpp index 3a56a4654..823399724 100644 --- a/source/games/whaven/src/ai.cpp +++ b/source/games/whaven/src/ai.cpp @@ -697,14 +697,14 @@ void attack(PLAYER& plr, int const i) { auto ang = plr.angle.ang.asbuild(); if ((a < ang && ang - a < 128) || (a > ang && ((ang + a) & 2047) < 128)) { if (krand() % 100 > 80) { - spritesound(S_SWORD1 + krand() % 3, &pspr); + spritesound(S_SWORD1 + krand() % 3, plr.actor()); return; } else { s = krand() % 50; plr.shieldpoints -= s; if (krand() % 100 > 50) { - spritesound(S_SWORD1 + krand() % 3, &pspr); + spritesound(S_SWORD1 + krand() % 3, plr.actor()); return; } } @@ -757,8 +757,8 @@ void attack(PLAYER& plr, int const i) { case KOBOLDTYPE: spritesound(S_GENSWING, actor); if ((krand() % 10) > 4) { - spritesound(S_KOBOLDHIT, &pspr); - spritesound(S_BREATH1 + (krand() % 6), &pspr); + spritesound(S_KOBOLDHIT, plr.actor()); + spritesound(S_BREATH1 + (krand() % 6), plr.actor()); } if (isWh2()) k = (krand() % 5) + 5; @@ -803,8 +803,8 @@ void attack(PLAYER& plr, int const i) { if (spr.picnum == NEWGUYMACE) { // damage 5 - 20 spritesound(S_PLRWEAPON2, actor); if (krand() % 10 > 4) { - spritesound(S_KOBOLDHIT, &pspr); - spritesound(S_BREATH1 + (krand() % 6), &pspr); + spritesound(S_KOBOLDHIT, plr.actor()); + spritesound(S_BREATH1 + (krand() % 6), plr.actor()); } k = (krand() % 15) + 5; break; @@ -837,8 +837,8 @@ void attack(PLAYER& plr, int const i) { else { spritesound(S_GENSWING, actor); if (krand() % 10 > 4) { - spritesound(S_SOCK1 + (krand() % 4), &pspr); - spritesound(S_BREATH1 + (krand() % 6), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); + spritesound(S_BREATH1 + (krand() % 6), plr.actor()); } k = (krand() % 4) + 1; } diff --git a/source/games/whaven/src/aidevil.cpp b/source/games/whaven/src/aidevil.cpp index 8d0d5447c..62f8d32f8 100644 --- a/source/games/whaven/src/aidevil.cpp +++ b/source/games/whaven/src/aidevil.cpp @@ -247,7 +247,6 @@ static void nukeddevil(PLAYER& plr, DWHActor* actor) static void castdevil(PLAYER& plr, DWHActor* actor) { - int i = actor->GetSpriteIndex(); SPRITE& spr = actor->s(); spr.lotag -= TICSPERFRAME; @@ -258,7 +257,7 @@ static void castdevil(PLAYER& plr, DWHActor* actor) if (spr.picnum == DEVILATTACK + 2) { spr.picnum = DEVIL; - spritesound(S_FIREBALL, &sprite[i]); + spritesound(S_FIREBALL, actor); castspell(plr, actor); SetNewStatus(actor, CHASE); } diff --git a/source/games/whaven/src/aigron.cpp b/source/games/whaven/src/aigron.cpp index 5e7b44c9a..00d9f61d8 100644 --- a/source/games/whaven/src/aigron.cpp +++ b/source/games/whaven/src/aigron.cpp @@ -379,13 +379,13 @@ static void castgron(PLAYER& plr, DWHActor* actor) if (spr.lotag < 0) { if (spr.picnum == GRONHALATTACK) { spr.extra--; - spritesound(S_THROWPIKE, &sprite[i]); + spritesound(S_THROWPIKE, actor); throwhalberd(i); SetNewStatus(actor, CHASE); } else if (spr.picnum == GRONMUATTACK) { spr.extra--; - spritesound(S_SPELL2, &sprite[i]); + spritesound(S_SPELL2, actor); castspell(plr, actor); SetNewStatus(actor, CHASE); } diff --git a/source/games/whaven/src/ainewguy.cpp b/source/games/whaven/src/ainewguy.cpp index e54aa6ae4..b487ded19 100644 --- a/source/games/whaven/src/ainewguy.cpp +++ b/source/games/whaven/src/ainewguy.cpp @@ -347,14 +347,14 @@ static void castnewguy(PLAYER& plr, DWHActor* actor) if (spr.picnum == NEWGUYCAST + 2) { spr.extra--; spr.picnum = NEWGUY; - spritesound(S_WISP, &sprite[i]); + spritesound(S_WISP, actor); skullycastspell(plr, i); SetNewStatus(actor, CHASE); } if (spr.picnum == NEWGUYBOW + 2) { spr.extra--; spr.picnum = NEWGUY; - spritesound(S_PLRWEAPON3, &sprite[i]); + spritesound(S_PLRWEAPON3, actor); newguyarrow(i, plr); SetNewStatus(actor, CHASE); } diff --git a/source/games/whaven/src/aispider.cpp b/source/games/whaven/src/aispider.cpp index a686e6f22..f44b8eac4 100644 --- a/source/games/whaven/src/aispider.cpp +++ b/source/games/whaven/src/aispider.cpp @@ -206,7 +206,7 @@ static void attackspider(PLAYER& plr, DWHActor* actor) spr.ang = (short)checksight_ang; attack(plr, i); if (krand() % 100 > ((plr.lvl * 7) + 20)) { - spritesound(S_SPIDERBITE, &sprite[i]); + spritesound(S_SPIDERBITE, actor); plr.poisoned = 1; plr.poisontime = 7200; showmessage("Poisoned", 360); diff --git a/source/games/whaven/src/input.cpp b/source/games/whaven/src/input.cpp index 1256cc07b..21fc1d490 100644 --- a/source/games/whaven/src/input.cpp +++ b/source/games/whaven/src/input.cpp @@ -404,15 +404,15 @@ void processinput(int num) { if (!onground && plr.onsomething != 0) { if (plr.fallz > 32768) { if ((krand() % 2) != 0) - spritesound(S_PLRPAIN1 + (krand() % 2), &sprite[plr.spritenum]); + spritesound(S_PLRPAIN1 + (krand() % 2), plr.actor()); else - spritesound(S_PUSH1 + (krand() % 2), &sprite[plr.spritenum]); + spritesound(S_PUSH1 + (krand() % 2), plr.actor()); addhealth(plr, -(plr.fallz >> 13)); plr.fallz = 0;// wango } else if (plr.fallz > 8192) { - spritesound(S_BREATH1 + (krand() % 2), &sprite[plr.spritenum]); + spritesound(S_BREATH1 + (krand() % 2), plr.actor()); } } @@ -527,7 +527,7 @@ void processinput(int num) { break; case SPIDER: // STOMP - spritesound(S_DEADSTEP, &sprite[onsprite]); + spritesound(S_DEADSTEP, &whActors[onsprite]); justplayed = 1; newstatus(onsprite, DIE); break; @@ -543,7 +543,7 @@ void processinput(int num) { case 1952: case 1941: case 1940: - spritesound(S_DEADSTEP, &sprite[plr.spritenum]); + spritesound(S_DEADSTEP, plr.actor()); justplayed = 1; break; @@ -554,7 +554,7 @@ void processinput(int num) { if (sprite[onsprite].picnum == RAT) { - spritesound(S_RATS1 + (krand() % 2), &sprite[onsprite]); + spritesound(S_RATS1 + (krand() % 2), &whActors[onsprite]); justplayed = 1; deletesprite(onsprite); } diff --git a/source/games/whaven/src/items.cpp b/source/games/whaven/src/items.cpp index 735885581..f9d885634 100644 --- a/source/games/whaven/src/items.cpp +++ b/source/games/whaven/src/items.cpp @@ -1054,7 +1054,7 @@ void InitItems() { if (plr.manatime < 1 && plr.invincibletime <= 0 && !plr.godMode) { - spritesound(S_FIREBALL, &actor->s()); + spritesound(S_FIREBALL, actor); addhealth(plr, -1); startredflash(30); } diff --git a/source/games/whaven/src/spellbooks.cpp b/source/games/whaven/src/spellbooks.cpp index c0af8612a..d89e1ae1e 100644 --- a/source/games/whaven/src/spellbooks.cpp +++ b/source/games/whaven/src/spellbooks.cpp @@ -51,7 +51,7 @@ void castaorb(PLAYER& plr) { switch (plr.currentorb) { case 0: // SCARE if (isWh2()) - spritesound(S_GENERALMAGIC4, &sprite[plr.spritenum]); + spritesound(S_GENERALMAGIC4, plr.actor()); plr.shadowtime = ((plr.lvl + 1) * 120) << 2; break; case 1: // NIGHTVISION @@ -59,16 +59,16 @@ void castaorb(PLAYER& plr) { break; case 2: // FREEZE if (isWh2()) - spritesound(S_GENERALMAGIC3, &sprite[plr.spritenum]); + spritesound(S_GENERALMAGIC3, plr.actor()); else - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); daang = plr.angle.ang.asbuild(); shootgun(plr, daang, 6); break; case 3: // MAGIC ARROW if (isWh2()) { lockon(plr,10,2); - spritesound(S_GENERALMAGIC2, &sprite[plr.spritenum]); + spritesound(S_GENERALMAGIC2, plr.actor()); } else { daang = (float)BClampAngle(plr.angle.ang.asbuild() - 36); @@ -76,42 +76,42 @@ void castaorb(PLAYER& plr) { daang = (float)BClampAngle(int(daang) + (k << 1)); shootgun(plr, daang, 2); } - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); } break; case 4: // OPEN DOORS daang = plr.angle.ang.asbuild(); shootgun(plr, daang, 7); if (isWh2()) - spritesound(S_DOORSPELL, &sprite[plr.spritenum]); + spritesound(S_DOORSPELL, plr.actor()); else - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); break; case 5: // FLY plr.orbactive[plr.currentorb] = 3600 + (plr.lvl * 120); if (isWh2()) - spritesound(S_GENERALMAGIC1, &sprite[plr.spritenum]); + spritesound(S_GENERALMAGIC1, plr.actor()); else - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); break; case 6: // FIREBALL if (isWh2()) { lockon(plr,3,3); - spritesound(S_FIRESPELL, &sprite[plr.spritenum]); + spritesound(S_FIRESPELL, plr.actor()); } else { daang = plr.angle.ang.asbuild(); shootgun(plr, daang, 3); - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); } break; case 7: // NUKE daang = plr.angle.ang.asbuild(); shootgun(plr, daang, 4); if (isWh2()) - spritesound(S_NUKESPELL, &sprite[plr.spritenum]); + spritesound(S_NUKESPELL, plr.actor()); else - spritesound(S_SPELL1, &sprite[plr.spritenum]); + spritesound(S_SPELL1, plr.actor()); break; } } diff --git a/source/games/whaven/src/weapons.cpp b/source/games/whaven/src/weapons.cpp index 4b89d2185..d609c2e41 100644 --- a/source/games/whaven/src/weapons.cpp +++ b/source/games/whaven/src/weapons.cpp @@ -1289,7 +1289,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) { if (hitspr.picnum == SKELETON || hitspr.picnum == SKELETONATTACK || hitspr.picnum == SKELETONDIE) - spritesound(S_SKELHIT1 + (krand() % 2), &hitspr); + spritesound(S_SKELHIT1 + (krand() % 2), hitActor); } // HERE @@ -1495,7 +1495,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) { if (hitspr.picnum == SKELETON || hitspr.picnum == SKELETONATTACK || hitspr.picnum == SKELETONDIE) - spritesound(S_SKELHIT1 + (krand() % 2), &hitspr); + spritesound(S_SKELHIT1 + (krand() % 2), hitActor); } // HERE switch (plr.currweapon) { @@ -1615,7 +1615,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) { if (hitspr.picnum == SKELETON || hitspr.picnum == SKELETONATTACK || hitspr.picnum == SKELETONDIE) - spritesound(S_SKELHIT1 + (krand() % 2), &hitspr); + spritesound(S_SKELHIT1 + (krand() % 2), hitActor); } newstatus(pHitInfo.hitsprite, DIE); } @@ -1706,7 +1706,8 @@ void shootgun(PLAYER& plr, float ang, int guntype) { if (ntag.tagsector < 0) { j = insertsprite(pHitInfo.hitsect, (short) 0); - auto& spawned = sprite[j]; + auto spawnedactor = &whActors[j]; + auto& spawned = spawnedactor->s(); spawned.x = pHitInfo.hitx; spawned.y = pHitInfo.hity; spawned.z = pHitInfo.hitz + (8 << 8); @@ -1724,7 +1725,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) { spawned.lotag = 32; spawned.hitag = 0; spawned.backuploc(); - spritesound(S_ARROWHIT, &spawned); + spritesound(S_ARROWHIT, spawnedactor); if (isWh2() && plr.weapon[6] == 3 && plr.currweapon == 6) { auto spawnedactor = &whActors[j]; @@ -2347,7 +2348,7 @@ void swingdaweapon(PLAYER& plr) { // || plr.currweaponframe == PIKEATTACK2+4 && plr.weapon[7] == 2 && plr.ammo[7] > 0) { shootgun(plr, daang, 10); - spritesound(S_THROWPIKE, &sprite[plr.spritenum]); + spritesound(S_THROWPIKE, plr.actor()); plr.hasshot = 1; return; } @@ -2372,12 +2373,12 @@ void swingdaweapon(PLAYER& plr) { if (plr.currweaponframe == PIKEATTACK1 + 4 && plr.weapon[7] == 2 && plr.ammo[7] > 0) { shootgun(plr, daang, 10); - spritesound(S_GENTHROW, &sprite[plr.spritenum]); + spritesound(S_GENTHROW, plr.actor()); plr.hasshot = 1; return; } else if (plr.currweaponframe == ZPIKEATTACK + 4 && plr.weapon[7] == 3 && plr.ammo[7] > 0) { lockon(plr, 3, 10); - spritesound(S_GENTHROW, &sprite[plr.spritenum]); + spritesound(S_GENTHROW, plr.actor()); plr.hasshot = 1; return; } @@ -2444,44 +2445,44 @@ void swingdacrunch(PLAYER& plr, int daweapon) { auto& pspr = sprite[player->spritenum]; switch (daweapon) { case 0: // fist - spritesound(S_SOCK1 + (krand() % 4), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); break; case 1: // dagger if ((krand() % 2) != 0) - spritesound(S_GORE1 + (krand() % 4), &pspr); + spritesound(S_GORE1 + (krand() % 4), plr.actor()); break; case 2: // short sword - spritesound(S_SWORD2 + (krand() % 3), &pspr); + spritesound(S_SWORD2 + (krand() % 3), plr.actor()); break; case 3: // morningstar - spritesound(S_SOCK1 + (krand() % 4), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); break; case 4: // broad sword - spritesound(S_SWORD1 + (krand() % 3), &pspr); + spritesound(S_SWORD1 + (krand() % 3), plr.actor()); break; case 5: // battle axe if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); else - spritesound(S_SWORD1 + (krand() % 3), &pspr); + spritesound(S_SWORD1 + (krand() % 3), plr.actor()); break; case 6: // bow break; case 7: // pike if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); else - spritesound(S_SWORD1 + (krand() % 3), &pspr); + spritesound(S_SWORD1 + (krand() % 3), plr.actor()); break; case 8: // two handed sword - spritesound(S_SWORD1 + (krand() % 2), &pspr); + spritesound(S_SWORD1 + (krand() % 2), plr.actor()); break; case 9: // halberd if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &pspr); + spritesound(S_SOCK1 + (krand() % 4), plr.actor()); else - spritesound(S_SWORD1 + (krand() % 3), &pspr); + spritesound(S_SWORD1 + (krand() % 3), plr.actor()); break; } } diff --git a/source/games/whaven/src/wh.h b/source/games/whaven/src/wh.h index 165d74354..7c0f1c13b 100644 --- a/source/games/whaven/src/wh.h +++ b/source/games/whaven/src/wh.h @@ -471,9 +471,11 @@ inline int SND_Sound(int sn) { return playsound(sn, 0, 0); } +/* inline int spritesound(int sn, spritetype *s, int loop = 0, int channel = CHAN_AUTO) { return playsound_internal(sn, s, 0, 0, loop, channel); } +*/ inline int spritesound(int sn, DWHActor* s, int loop = 0, int channel = CHAN_AUTO) { return playsound_internal(sn, &s->s(), 0, 0, loop, channel); diff --git a/source/games/whaven/src/whfx.cpp b/source/games/whaven/src/whfx.cpp index fc0a80a40..cd5e3d2a9 100644 --- a/source/games/whaven/src/whfx.cpp +++ b/source/games/whaven/src/whfx.cpp @@ -442,7 +442,7 @@ void teleporter() { warpfxsprite(plr.spritenum); plr.angle.settarget(daang); plr.justwarpedfx = 48; - spritesound(S_WARP, &sprite[plr.spritenum]); + spritesound(S_WARP, plr.actor()); setsprite(plr.spritenum, plr.x, plr.y, plr.z + (32 << 8)); } } @@ -464,7 +464,7 @@ void teleporter() { CompleteLevel(currentLevel); break; case 2: // ENDOFDEMO - spritesound(S_THUNDER1, &sprite[plr.spritenum]); + spritesound(S_THUNDER1, plr.actor()); justteleported = true; CompleteLevel(nullptr); break; @@ -611,7 +611,7 @@ void sectorsounds() { } } else { if (plr.z <= plr.Sector()->floorz - (8 << 8)) - spritesound(sec, &sprite[plr.spritenum]); + spritesound(sec, plr.actor()); } } } @@ -823,7 +823,7 @@ void makeasplash(int picnum, PLAYER& plr) { if(!isWh2() && picnum == SLIMESPLASH) break; - spritesound(S_SPLASH1 + (krand() % 3), &spawned); + spritesound(S_SPLASH1 + (krand() % 3), spawnedactor); break; case LAVASPLASH: break; @@ -839,7 +839,8 @@ void makemonstersplash(int picnum, int i) { return; int j = insertsprite(sprite[i].sectnum, MASPLASH); - auto& spawned = sprite[j]; + auto spawnedactor = &whActors[j]; + auto& spawned = spawnedactor->s(); spawned.x = sprite[i].x; spawned.y = sprite[i].y; spawned.z = sector[sprite[i].sectnum].floorz + (tileHeight(picnum) << 8); @@ -873,14 +874,14 @@ void makemonstersplash(int picnum, int i) { if ((gotpic[WATER >> 3] & (1 << (WATER & 7))) > 0) { gotpic[WATER >> 3] &= ~(1 << (WATER & 7)); if ((krand() % 2) != 0) - spritesound(S_SPLASH1 + (krand() % 3), &spawned); + spritesound(S_SPLASH1 + (krand() % 3), spawnedactor); } } if ((krand() % 2) != 0) { if ((gotpic[SLIME >> 3] & (1 << (SLIME & 7))) > 0) { gotpic[SLIME >> 3] &= ~(1 << (SLIME & 7)); if ((krand() % 2) != 0) - spritesound(S_SPLASH1 + (krand() % 3), &spawned); + spritesound(S_SPLASH1 + (krand() % 3), spawnedactor); } } break; diff --git a/source/games/whaven/src/whobj.cpp b/source/games/whaven/src/whobj.cpp index ee4e99f49..18408ef8c 100644 --- a/source/games/whaven/src/whobj.cpp +++ b/source/games/whaven/src/whobj.cpp @@ -482,14 +482,14 @@ void newstatus(short sn, int seq) { case LIFTUP: if (soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, -1, CHAN_CART) == 0) { spritesound(S_CLUNK, actor); - spritesound(S_CHAIN1, &spr, 5, CHAN_CART); + spritesound(S_CHAIN1, actor, 5, CHAN_CART); } ChangeActorStat(actor, LIFTUP); break; case LIFTDN: if (soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, -1, CHAN_CART) == 0) { spritesound(S_CLUNK, actor); - spritesound(S_CHAIN1, &spr, 5, CHAN_CART); + spritesound(S_CHAIN1, actor, 5, CHAN_CART); } ChangeActorStat(actor, LIFTDN); break; @@ -1589,7 +1589,7 @@ boolean damageactor(PLAYER& plr, DWHActor* hitactor, DWHActor* actor) if (spr.picnum == PLASMA) addhealth(plr, -((krand() & 15) + 15)); else if (spr.picnum == FATSPANK) { - spritesound(S_GORE1A + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_GORE1A + (krand() % 3), plr.actor()); addhealth(plr, -((krand() & 10) + 10)); if ((krand() % 100) > 90) { plr.poisoned = 1; diff --git a/source/games/whaven/src/whplr.cpp b/source/games/whaven/src/whplr.cpp index 1c3850587..61e32b095 100644 --- a/source/games/whaven/src/whplr.cpp +++ b/source/games/whaven/src/whplr.cpp @@ -45,7 +45,7 @@ void playerdead(PLAYER& plr) { if (plr.spiked == 1) { plr.spiketics = spikeanimtics[0].daweapontics; - spritesound(S_GORE1, &sprite[plr.spritenum]); + spritesound(S_GORE1, plr.actor()); SND_Sound(S_HEARTBEAT); } @@ -260,7 +260,7 @@ void plruse(PLAYER& plr) { showmessage("find door trigger", 360); } } - spritesound(S_PUSH1 + (krand() % 2), &sprite[plr.spritenum]); + spritesound(S_PUSH1 + (krand() % 2), plr.actor()); } } if (nt.tagsprite >= 0) { @@ -336,10 +336,10 @@ void chunksofmeat(PLAYER& plr, DWHActor* hitActor, int hitx, int hity, int hitz, if (hitspr.picnum == SKELETON || hitspr.picnum == SKELETONATTACK || hitspr.picnum == SKELETONDIE) { - spritesound(S_SKELHIT1 + (krand() % 2), &hitspr); + spritesound(S_SKELHIT1 + (krand() % 2), hitActor); } else { if (krand() % 100 > 60) - spritesound(S_GORE1 + (krand() % 4), &hitspr); + spritesound(S_GORE1 + (krand() % 4), hitActor); } if (hitActor != nullptr) { diff --git a/source/games/whaven/src/whtag.cpp b/source/games/whaven/src/whtag.cpp index 9596a828a..09db11172 100644 --- a/source/games/whaven/src/whtag.cpp +++ b/source/games/whaven/src/whtag.cpp @@ -55,7 +55,7 @@ void operatesprite(PLAYER& plr, short s) { case STAINSCENE: switch (spr.lotag) { case 2: - spritesound(S_GLASSBREAK1 + (rand() % 3), &sprite[s]); + spritesound(S_GLASSBREAK1 + (rand() % 3), actor); for (int j = 0; j < 20; j++) { shards(s, 2); } @@ -838,7 +838,6 @@ void operatesector(PLAYER& plr, int s) { } if (datag == 4000) { -// sector[s].lotag=0; WHSpriteIterator it; while (auto itActor = it.Next()) { @@ -846,14 +845,12 @@ void operatesector(PLAYER& plr, int s) { if (sector[s].hitag == spk.hitag && spk.extra < 1) { SetNewStatus(itActor, FLOCKSPAWN); if (soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, -1, CHAN_BAT) == 0) { - spritesound(S_BATSLOOP, &spk, -1, CHAN_BAT); - // sector[s].lotag = sector[s].hitag = 0; + spritesound(S_BATSLOOP, itActor, -1, CHAN_BAT); } } } } if (datag == 4001) { -// sector[s].lotag=0; WHSpriteIterator it; while (auto itActor = it.Next()) {