raze/wadsrc/static/zscript/games/duke/world/redneckbreak.zs
Christoph Oelckers 9e3318a2fb - moved spawnclasses and breakwall definitions from .def to RMAPINFO.
.def is not the right place for this - it needs to run very early in the process, before scripted actors are loaded, so doing this stuff there means that half the initialization has to be postponed and error reporting is sub-par.
These are now part of RMAPINFO which gets parsed as one of the very last things - it is also where GZDoom is doing some of these things.

The better error reporting also allowed fixing some errors in these definitions.
2022-12-11 19:43:57 +01:00

24 lines
No EOL
632 B
Text

// Container for handler functions that handle walls with breakable textures.
// Note that this must be a class, not a struct, so that the internal lookup functions can find it.
class RedneckBreakWalls
{
static void breakwall(TextureID newpn, DukeActor spr, walltype wal)
{
wal.SetTexture(walltype.main, newpn);
spr.PlayActorSound("VENT_BUST");
spr.PlayActorSound("GLASS_HEAVYBREAK");
spr.lotsofglass(10, wal);
}
static void SinglePlayerBreak(walltype wal, TextureID newtex, Sound snd, DukeActor hitter)
{
if (ud.multimode < 2)
{
wal.SetTexture(walltype.main, newtex);
hitter.PlayActorSound(snd);
}
}
}