From 757096e7df15c14b9b10352fa91663483f9e34f8 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 10 Aug 2025 00:19:46 +0200 Subject: all --- src/fpsgame/entities.cpp | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'src/fpsgame/entities.cpp') diff --git a/src/fpsgame/entities.cpp b/src/fpsgame/entities.cpp index 21d44a6..656a9b0 100644 --- a/src/fpsgame/entities.cpp +++ b/src/fpsgame/entities.cpp @@ -77,17 +77,6 @@ namespace entities { if(!mdl) continue; preloadmodel(mdl); } - loopv(ents) { - extentity &e = *ents[i]; - switch(e.type) { - case TELEPORT: - if(e.attr2 > 0) preloadmodel(mapmodelname(e.attr2)); - [[fallthrough]]; - case JUMPPAD: - if(e.attr4 > 0) preloadmapsound(e.attr4); - break; - } - } } void renderentities() { loopv(ents) { @@ -133,7 +122,7 @@ namespace entities { //particle_text(d->abovehead(), is.name, PART_TEXT, 2000, 0xFFC864, 4.0f, -8); particle_icon(d->abovehead(), is.icon%4, is.icon/4, PART_HUD_ICON_GREY, 2000, 0xFFFFFF, 2.0f, -8); } - playsound(itemstats[type-I_SHELLS].sound, d!=h ? &d->o : NULL, NULL, 0, 0, 0, -1, 0, 1500); + playsound(itemstats[type-I_SHELLS].sound, d!=h ? &d->o : NULL, NULL, 0, 0, -1, 0, 1500); d->pickup(type); switch(type) { case I_TINYARMOUR: pwitemspicked[0]++; break; @@ -147,11 +136,11 @@ namespace entities { if(d==h) switch(type) { case I_BOOST: conoutf(CON_GAMEINFO, "\f2you got the health boost!"); - playsound(S_V_BOOST, NULL, NULL, 0, 0, 0, -1, 0, 3000); + playsound(S_V_BOOST, NULL, NULL, 0, 0, -1, 0, 3000); break; case I_QUAD: conoutf(CON_GAMEINFO, "\f2you got the quad!"); - playsound(S_V_QUAD, NULL, NULL, 0, 0, 0, -1, 0, 3000); + playsound(S_V_QUAD, NULL, NULL, 0, 0, -1, 0, 3000); break; } } @@ -160,11 +149,11 @@ namespace entities { if(ents.inrange(tp) && ents[tp]->type == TELEPORT) { extentity &e = *ents[tp]; if(e.attr4 >= 0) { - int snd = S_TELEPORT, flags = 0; - if(e.attr4 > 0) { snd = e.attr4; flags = SND_MAP; } + int snd = S_TELEPORT; + if(e.attr4 > 0) snd = e.attr4; fpsent *h = followingplayer(player1); - playsound(snd, d==h ? NULL : &e.o, NULL, flags); - if(d!=h && ents.inrange(td) && ents[td]->type == TELEDEST) playsound(snd, &ents[td]->o, NULL, flags); + playsound(snd, d==h ? NULL : &e.o, NULL); + if(d!=h && ents.inrange(td) && ents[td]->type == TELEDEST) playsound(snd, &ents[td]->o, NULL); } } if(local && d->clientnum >= 0) { @@ -182,9 +171,9 @@ namespace entities { if(ents.inrange(jp) && ents[jp]->type == JUMPPAD) { extentity &e = *ents[jp]; if(e.attr4 >= 0) { - int snd = S_JUMPPAD, flags = 0; - if(e.attr4 > 0) { snd = e.attr4; flags = SND_MAP; } - playsound(snd, d == followingplayer(player1) ? NULL : &e.o, NULL, flags); + int snd = S_JUMPPAD; + if(e.attr4 > 0) snd = e.attr4; + playsound(snd, d == followingplayer(player1) ? NULL : &e.o, NULL); } } if(local && d->clientnum >= 0) { -- cgit v1.2.3