ifpdistl 1024
ifp pfacing
ifp palive
ifhitspace
ifcount 30
{
quote 4
}
switch sprite[].pal
case 0
{ soundonce DOOR_LOCK_A }
break
case 1
{ soundonce DOOR_LOCK_B }
break
case 2
{ soundonce DOOR_LOCK_C }
break
endswitchAlthough this is just an example of the literal interpretation the compiler is seeing, there's actually no harm in adding brackets around single command conditionals, and in some cases may make for more readable code. You actually do this with the soundonce commands within your switch statement, and if you wanted you could remove those brackets without change in the code behavior.
You can also safely (and IMO should) put brackets surrounding the content of actor, (def)state, and event code as well:
useractor notenemy LOCKEDDOOR
{
cstat 32784 // invisible, wall-aligned
[. . .]
}
endswitch
}
enda

Help
Duke4.net
DNF #1
Duke 3D #1



