Fix more wrong code (constant arrays not declared as "static const)

This fixes a crash in recent GZDoom devbuilds.
This commit is contained in:
Mari the Deer 2022-02-14 01:22:58 +01:00
commit 5bac1614c4
3 changed files with 6 additions and 6 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2pre r158 \cu(Mon 14 Feb 01:14:50 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r158 \cu(2022-02-14 01:14:50)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2pre r160 \cu(Mon 14 Feb 01:23:14 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r160 \cu(2022-02-14 01:23:14)\c-";

View file

@ -399,7 +399,7 @@ extend Class SWWMHandler
private ui bool CheatInput( InputEvent e )
{
// cheat code handling
String cht[] =
static const String cht[] =
{
"swwmlodsofemone", "swwmdeeplore", "swwmfroggygang", "swwmforgetaboutit",
"swwmmisterproper", "swwmstinky",
@ -412,7 +412,7 @@ extend Class SWWMHandler
"swwmmarioisaweenie", "swwmpunish", "swwmboingball",
"swwmgassy", "swwmiamsuperman", "swwmtouchstone"
};
String cmd[] =
static const String cmd[] =
{
"swwmmoneycheat", "swwmlorecheat", "swwmfroggycheat", "swwmamnesiacheat",
"swwmjanitorcheat", "swwmsewercountcheat",

View file

@ -179,7 +179,7 @@ extend Class SWWMStaticHandler
return;
}
// decode
int cypher[] = {0xAD,0xEA,0xDB,0xED};
static const int cypher[] = {0xAD,0xEA,0xDB,0xED};
String nstr = "";
for ( int i=0; i<statestr.length(); i+=2 )
{
@ -301,7 +301,7 @@ extend Class SWWMStaticHandler
progstr.Replace("}","");
progstr.Replace("\"","");
// cheap encode
int cypher[] = {0xAD,0xEA,0xDB,0xED};
static const int cypher[] = {0xAD,0xEA,0xDB,0xED};
String nstr = "";
for ( int i=0; i<statestr.length(); i++ )
{