checked 5 gametypes series scripts

_callbacksetup.gsc, _damagefeedback.gsc, _hud.gsc, _perplayer.gsc, and _serversettings have been checked for both patch_zm and patch_mp.
This commit is contained in:
JezuzLizard 2020-04-29 12:15:40 -07:00
parent 18b5824147
commit 1970197ae0
12 changed files with 249 additions and 279 deletions

View File

@ -6,7 +6,7 @@
#include maps/mp/_audio;
#include maps/mp/_utility;
codecallback_startgametype()
codecallback_startgametype() //checked matches cerberus output
{
if ( !isDefined( level.gametypestarted ) || !level.gametypestarted )
{
@ -15,19 +15,19 @@ codecallback_startgametype()
}
}
codecallback_finalizeinitialization()
codecallback_finalizeinitialization() //checked matches cerberus output
{
maps/mp/_utility::callback( "on_finalize_initialization" );
}
codecallback_playerconnect()
codecallback_playerconnect() //checked matches cerberus output
{
self endon( "disconnect" );
self thread maps/mp/_audio::monitor_player_sprint();
[[ level.callbackplayerconnect ]]();
}
codecallback_playerdisconnect()
codecallback_playerdisconnect() //checked matches cerberus output
{
self notify( "disconnect" );
level notify( "disconnect" );
@ -35,75 +35,81 @@ codecallback_playerdisconnect()
[[ level.callbackplayerdisconnect ]]();
}
codecallback_hostmigration()
codecallback_hostmigration() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_HostMigration****" );
#/
*/
[[ level.callbackhostmigration ]]();
}
codecallback_hostmigrationsave()
codecallback_hostmigrationsave() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_HostMigrationSave****" );
#/
*/
[[ level.callbackhostmigrationsave ]]();
}
codecallback_playermigrated()
codecallback_playermigrated() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_PlayerMigrated****" );
#/
*/
[[ level.callbackplayermigrated ]]();
}
codecallback_playerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex )
codecallback_playerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerdamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
}
codecallback_playerkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration )
codecallback_playerkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerkilled ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration );
}
codecallback_playerlaststand( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration )
codecallback_playerlaststand( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerlaststand ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration );
}
codecallback_playermelee( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit )
codecallback_playermelee( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayermelee ]]( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit );
}
codecallback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex )
codecallback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex ) //checked matches cerberus output
{
[[ level.callbackactordamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
}
codecallback_actorkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset )
codecallback_actorkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset ) //checked matches cerberus output
{
[[ level.callbackactorkilled ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset );
}
codecallback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname )
codecallback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname ) //checked matches cerberus output
{
[[ level.callbackvehicledamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname );
}
codecallback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, timeoffset )
codecallback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, timeoffset ) //checked matches cerberus output
{
[[ level.callbackvehicleradiusdamage ]]( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, timeoffset );
}
codecallback_faceeventnotify( notify_msg, ent )
codecallback_faceeventnotify( notify_msg, ent ) //checked matches cerberus output
{
if ( isDefined( ent ) && isDefined( ent.do_face_anims ) && ent.do_face_anims )
{
@ -114,7 +120,7 @@ codecallback_faceeventnotify( notify_msg, ent )
}
}
codecallback_menuresponse( action, arg )
codecallback_menuresponse( action, arg ) //checked matches cerberus output
{
if ( !isDefined( level.menuresponsequeue ) )
{
@ -129,18 +135,18 @@ codecallback_menuresponse( action, arg )
level notify( "menuresponse_queue" );
}
menuresponsequeuepump()
menuresponsequeuepump() //checked changed to match cerberus output
{
while ( 1 )
{
level waittill( "menuresponse_queue" );
level.menuresponsequeue[ 0 ].ent notify( "menuresponse" );
level.menuresponsequeue[ 0 ].ent notify( "menuresponse", level.menuresponsequeue[0].action, level.menuresponsequeue[0].arg );
arrayremoveindex( level.menuresponsequeue, 0, 0 );
wait 0,05;
wait 0.05;
}
}
setupcallbacks()
setupcallbacks() //checked matches cerberus output
{
setdefaultcallbacks();
level.idflags_radius = 1;
@ -156,29 +162,31 @@ setupcallbacks()
level.idflags_passthru = 1024;
}
setdefaultcallbacks()
setdefaultcallbacks() //checked matches cerberus output
{
level.callbackstartgametype = ::maps/mp/gametypes/_globallogic::callback_startgametype;
level.callbackplayerconnect = ::maps/mp/gametypes/_globallogic_player::callback_playerconnect;
level.callbackplayerdisconnect = ::maps/mp/gametypes/_globallogic_player::callback_playerdisconnect;
level.callbackplayerdamage = ::maps/mp/gametypes/_globallogic_player::callback_playerdamage;
level.callbackplayerkilled = ::maps/mp/gametypes/_globallogic_player::callback_playerkilled;
level.callbackplayermelee = ::maps/mp/gametypes/_globallogic_player::callback_playermelee;
level.callbackplayerlaststand = ::maps/mp/gametypes/_globallogic_player::callback_playerlaststand;
level.callbackactordamage = ::maps/mp/gametypes/_globallogic_actor::callback_actordamage;
level.callbackactorkilled = ::maps/mp/gametypes/_globallogic_actor::callback_actorkilled;
level.callbackvehicledamage = ::maps/mp/gametypes/_globallogic_vehicle::callback_vehicledamage;
level.callbackvehicleradiusdamage = ::maps/mp/gametypes/_globallogic_vehicle::callback_vehicleradiusdamage;
level.callbackplayermigrated = ::maps/mp/gametypes/_globallogic_player::callback_playermigrated;
level.callbackhostmigration = ::maps/mp/gametypes/_hostmigration::callback_hostmigration;
level.callbackhostmigrationsave = ::maps/mp/gametypes/_hostmigration::callback_hostmigrationsave;
level.callbackstartgametype = maps/mp/gametypes/_globallogic::callback_startgametype;
level.callbackplayerconnect = maps/mp/gametypes/_globallogic_player::callback_playerconnect;
level.callbackplayerdisconnect = maps/mp/gametypes/_globallogic_player::callback_playerdisconnect;
level.callbackplayerdamage = maps/mp/gametypes/_globallogic_player::callback_playerdamage;
level.callbackplayerkilled = maps/mp/gametypes/_globallogic_player::callback_playerkilled;
level.callbackplayermelee = maps/mp/gametypes/_globallogic_player::callback_playermelee;
level.callbackplayerlaststand = maps/mp/gametypes/_globallogic_player::callback_playerlaststand;
level.callbackactordamage = maps/mp/gametypes/_globallogic_actor::callback_actordamage;
level.callbackactorkilled = maps/mp/gametypes/_globallogic_actor::callback_actorkilled;
level.callbackvehicledamage = maps/mp/gametypes/_globallogic_vehicle::callback_vehicledamage;
level.callbackvehicleradiusdamage = maps/mp/gametypes/_globallogic_vehicle::callback_vehicleradiusdamage;
level.callbackplayermigrated = maps/mp/gametypes/_globallogic_player::callback_playermigrated;
level.callbackhostmigration = maps/mp/gametypes/_hostmigration::callback_hostmigration;
level.callbackhostmigrationsave = maps/mp/gametypes/_hostmigration::callback_hostmigrationsave;
}
abortlevel()
abortlevel() //checked matches cerberus output
{
/*
/#
println( "ERROR: Aborting level - gametype is not supported" );
#/
*/
level.callbackstartgametype = ::callbackvoid;
level.callbackplayerconnect = ::callbackvoid;
level.callbackplayerdisconnect = ::callbackvoid;
@ -193,11 +201,12 @@ abortlevel()
exitlevel( 0 );
}
codecallback_glasssmash( pos, dir )
codecallback_glasssmash( pos, dir ) //checked matches cerberus output
{
level notify( "glass_smash" );
}
callbackvoid()
callbackvoid() //checked matches cerberus output
{
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
precacheshader( "damage_feedback" );
precacheshader( "damage_feedback_flak" );
@ -7,7 +7,7 @@ init()
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -24,7 +24,7 @@ onplayerconnect()
}
}
updatedamagefeedback( mod, inflictor, perkfeedback )
updatedamagefeedback( mod, inflictor, perkfeedback ) //checked matches cerberus output
{
if ( !isplayer( self ) || sessionmodeiszombiesgame() )
{
@ -58,7 +58,10 @@ updatedamagefeedback( mod, inflictor, perkfeedback )
break;
}
}
else self playlocalsound( "mpl_hit_alert_low" );
else
{
self playlocalsound( "mpl_hit_alert_low" );
}
}
if ( isDefined( perkfeedback ) )
{
@ -79,19 +82,19 @@ updatedamagefeedback( mod, inflictor, perkfeedback )
}
}
playhitsound( mod, alert )
playhitsound( mod, alert ) //checked matches cerberus output
{
self endon( "disconnect" );
if ( self.hitsoundtracker )
{
self.hitsoundtracker = 0;
self playlocalsound( alert );
wait 0,05;
wait 0.05;
self.hitsoundtracker = 1;
}
}
updatespecialdamagefeedback( hitent )
updatespecialdamagefeedback( hitent ) //checked matches cerberus output
{
if ( !isplayer( self ) )
{
@ -105,7 +108,7 @@ updatespecialdamagefeedback( hitent )
{
return;
}
wait 0,05;
wait 0.05;
if ( !isDefined( self.directionalhitarray ) )
{
self.directionalhitarray = [];
@ -120,15 +123,14 @@ updatespecialdamagefeedback( hitent )
}
}
sendhitspecialeventatframeend( hitent )
sendhitspecialeventatframeend( hitent ) //checked changed to match cerberus output
{
self endon( "disconnect" );
waittillframeend;
enemyshit = 0;
value = 1;
entbitarray0 = 0;
i = 0;
while ( i < 32 )
for ( i = 0; i < 32; i++ )
{
if ( isDefined( self.directionalhitarray[ i ] ) && self.directionalhitarray[ i ] != 0 )
{
@ -136,11 +138,9 @@ sendhitspecialeventatframeend( hitent )
enemyshit++;
}
value *= 2;
i++;
}
entbitarray1 = 0;
i = 33;
while ( i < 64 )
for ( i = 33; i < 64; i++ )
{
if ( isDefined( self.directionalhitarray[ i ] ) && self.directionalhitarray[ i ] != 0 )
{
@ -148,7 +148,6 @@ sendhitspecialeventatframeend( hitent )
enemyshit++;
}
value *= 2;
i++;
}
if ( enemyshit )
{
@ -158,3 +157,4 @@ sendhitspecialeventatframeend( hitent )
entbitarray0 = 0;
entbitarray1 = 0;
}

View File

@ -1,5 +1,5 @@
init()
init() //checked changed to match cerberus output
{
precacheshader( "progress_bar_bg" );
precacheshader( "progress_bar_fg" );
@ -16,13 +16,9 @@ init()
level.uiparent.height = 0;
level.uiparent.children = [];
level.fontheight = 12;
_a103 = level.teams;
_k103 = getFirstArrayKey( _a103 );
while ( isDefined( _k103 ) )
foreach ( team in level.teams )
{
team = _a103[ _k103 ];
level.hud[ team ] = spawnstruct();
_k103 = getNextArrayKey( _a103, _k103 );
}
level.primaryprogressbary = -61;
level.primaryprogressbarx = 0;
@ -30,7 +26,7 @@ init()
level.primaryprogressbarwidth = 120;
level.primaryprogressbartexty = -75;
level.primaryprogressbartextx = 0;
level.primaryprogressbarfontsize = 1,4;
level.primaryprogressbarfontsize = 1.4;
if ( level.splitscreen )
{
level.primaryprogressbarx = 20;
@ -45,7 +41,7 @@ init()
level.secondaryprogressbarwidth = 120;
level.secondaryprogressbartexty = -100;
level.secondaryprogressbartextx = 0;
level.secondaryprogressbarfontsize = 1,4;
level.secondaryprogressbarfontsize = 1.4;
if ( level.splitscreen )
{
level.secondaryprogressbarx = 20;
@ -58,31 +54,31 @@ init()
level.teamprogressbarheight = 14;
level.teamprogressbarwidth = 192;
level.teamprogressbartexty = 8;
level.teamprogressbarfontsize = 1,65;
level.teamprogressbarfontsize = 1.65;
setdvar( "ui_generic_status_bar", 0 );
if ( level.splitscreen )
{
level.lowertextyalign = "BOTTOM";
level.lowertexty = -42;
level.lowertextfontsize = 1,4;
level.lowertextfontsize = 1.4;
}
else
{
level.lowertextyalign = "CENTER";
level.lowertexty = 40;
level.lowertextfontsize = 1,4;
level.lowertextfontsize = 1.4;
}
}
fontpulseinit()
fontpulseinit() //checked matches cerberus output
{
self.basefontscale = self.fontscale;
self.maxfontscale = self.fontscale * 2;
self.inframes = 1,5;
self.inframes = 1.5;
self.outframes = 3;
}
fontpulse( player )
fontpulse( player ) //checked matches cerberus output
{
self notify( "fontPulse" );
self endon( "fontPulse" );
@ -92,7 +88,7 @@ fontpulse( player )
player endon( "joined_spectators" );
if ( self.outframes == 0 )
{
self.fontscale = 0,01;
self.fontscale = 0.01;
}
else
{
@ -100,25 +96,25 @@ fontpulse( player )
}
if ( self.inframes > 0 )
{
self changefontscaleovertime( self.inframes * 0,05 );
self changefontscaleovertime( self.inframes * 0.05 );
self.fontscale = self.maxfontscale;
wait ( self.inframes * 0,05 );
wait ( self.inframes * 0.05 );
}
else
{
self.fontscale = self.maxfontscale;
self.alpha = 0;
self fadeovertime( self.outframes * 0,05 );
self fadeovertime( self.outframes * 0.05 );
self.alpha = 1;
}
if ( self.outframes > 0 )
{
self changefontscaleovertime( self.outframes * 0,05 );
self changefontscaleovertime( self.outframes * 0.05 );
self.fontscale = self.basefontscale;
}
}
fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadername )
fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadername ) //checked matches cerberus output
{
wait startwait;
if ( !isDefined( self ) )
@ -174,3 +170,4 @@ fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadern
self.blackscreen = undefined;
}
}

View File

@ -1,6 +1,6 @@
#include maps/mp/_utility;
init( id, playerbegincallback, playerendcallback )
init( id, playerbegincallback, playerendcallback ) //checked matches cerberus output
{
precacheshader( "objpoint_default" );
handler = spawnstruct();
@ -14,7 +14,7 @@ init( id, playerbegincallback, playerendcallback )
return handler;
}
enable( handler )
enable( handler ) //checked partially changed to match cerberus output didn't change while loop to for loop to prevent infinite loop continue bug
{
if ( handler.enabled )
{
@ -23,11 +23,9 @@ enable( handler )
handler.enabled = 1;
level.handlerglobalflagval++;
players = get_players();
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
players[ i ].handlerflagval = level.handlerglobalflagval;
i++;
}
players = handler.players;
i = 0;
@ -38,18 +36,15 @@ enable( handler )
i++;
continue;
}
else
if ( players[ i ].handlers[ handler.id ].ready )
{
if ( players[ i ].handlers[ handler.id ].ready )
{
players[ i ] handleplayer( handler );
}
players[ i ] handleplayer( handler );
}
i++;
}
}
disable( handler )
disable( handler ) //checked partially changed to match cerberus output didn't change while loop to for loop to prevent infinite loop continue bug
{
if ( !handler.enabled )
{
@ -58,11 +53,9 @@ disable( handler )
handler.enabled = 0;
level.handlerglobalflagval++;
players = get_players();
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
players[ i ].handlerflagval = level.handlerglobalflagval;
i++;
}
players = handler.players;
i = 0;
@ -73,18 +66,15 @@ disable( handler )
i++;
continue;
}
else
if ( players[ i ].handlers[ handler.id ].ready )
{
if ( players[ i ].handlers[ handler.id ].ready )
{
players[ i ] unhandleplayer( handler, 0, 0 );
}
players[ i ] unhandleplayer( handler, 0, 0 );
}
i++;
}
}
onplayerconnect( handler )
onplayerconnect( handler ) //checked matches cerberus output
{
for ( ;; )
{
@ -106,24 +96,22 @@ onplayerconnect( handler )
}
}
onplayerdisconnect( handler )
onplayerdisconnect( handler ) //checked changed to match cerberus output
{
self waittill( "disconnect" );
newplayers = [];
i = 0;
while ( i < handler.players.size )
for ( i = 0; i < handler.players.size; i++ )
{
if ( handler.players[ i ] != self )
{
newplayers[ newplayers.size ] = handler.players[ i ];
}
i++;
}
handler.players = newplayers;
self thread unhandleplayer( handler, 1, 1 );
}
onjoinedteam( handler )
onjoinedteam( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -133,7 +121,7 @@ onjoinedteam( handler )
}
}
onjoinedspectators( handler )
onjoinedspectators( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -143,7 +131,7 @@ onjoinedspectators( handler )
}
}
onplayerspawned( handler )
onplayerspawned( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -153,7 +141,7 @@ onplayerspawned( handler )
}
}
onplayerkilled( handler )
onplayerkilled( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -163,7 +151,7 @@ onplayerkilled( handler )
}
}
handleplayer( handler )
handleplayer( handler ) //checked matches cerberus output
{
self.handlers[ handler.id ].ready = 1;
if ( !handler.enabled )
@ -178,7 +166,7 @@ handleplayer( handler )
self thread [[ handler.playerbegincallback ]]();
}
unhandleplayer( handler, unsetready, disconnected )
unhandleplayer( handler, unsetready, disconnected ) //checked matches cerberus output
{
if ( !disconnected && unsetready )
{
@ -194,3 +182,4 @@ unhandleplayer( handler, unsetready, disconnected )
}
self thread [[ handler.playerendcallback ]]( disconnected );
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
level.hostname = getDvar( "sv_hostname" );
if ( level.hostname == "" )
@ -64,7 +64,7 @@ init()
}
}
updateserversettings()
updateserversettings() //checked matches cerberus output
{
sv_hostname = getDvar( "sv_hostname" );
if ( level.hostname != sv_hostname )
@ -92,7 +92,7 @@ updateserversettings()
}
}
constraingametype( gametype )
constraingametype( gametype ) //checked partially changed to match cerberus output did not change while loop to for for loop because of infinite loop caused by continues
{
entities = getentarray();
i = 0;
@ -108,7 +108,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "tdm" )
if ( gametype == "tdm" )
{
if ( isDefined( entity.script_gametype_tdm ) && entity.script_gametype_tdm != "1" )
{
@ -117,7 +117,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "ctf" )
if ( gametype == "ctf" )
{
if ( isDefined( entity.script_gametype_ctf ) && entity.script_gametype_ctf != "1" )
{
@ -126,7 +126,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "hq" )
if ( gametype == "hq" )
{
if ( isDefined( entity.script_gametype_hq ) && entity.script_gametype_hq != "1" )
{
@ -135,7 +135,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "sd" )
if ( gametype == "sd" )
{
if ( isDefined( entity.script_gametype_sd ) && entity.script_gametype_sd != "1" )
{
@ -144,21 +144,18 @@ constraingametype( gametype )
i++;
continue;
}
else
if ( gametype == "koth" )
{
if ( gametype == "koth" )
if ( isDefined( entity.script_gametype_koth ) && entity.script_gametype_koth != "1" )
{
if ( isDefined( entity.script_gametype_koth ) && entity.script_gametype_koth != "1" )
{
entity delete();
}
entity delete();
}
}
i++;
}
}
constrainmapsize( mapsize )
constrainmapsize( mapsize ) //checked partially changed to match cerberus output did not change while loop to for for loop because of infinite loop caused by continues
{
entities = getentarray();
i = 0;
@ -174,7 +171,7 @@ constrainmapsize( mapsize )
i++;
continue;
}
else if ( int( mapsize ) == 16 )
if ( int( mapsize ) == 16 )
{
if ( isDefined( entity.script_mapsize_16 ) && entity.script_mapsize_16 != "1" )
{
@ -183,7 +180,7 @@ constrainmapsize( mapsize )
i++;
continue;
}
else if ( int( mapsize ) == 32 )
if ( int( mapsize ) == 32 )
{
if ( isDefined( entity.script_mapsize_32 ) && entity.script_mapsize_32 != "1" )
{
@ -192,16 +189,14 @@ constrainmapsize( mapsize )
i++;
continue;
}
else
if ( int( mapsize ) == 64 )
{
if ( int( mapsize ) == 64 )
if ( isDefined( entity.script_mapsize_64 ) && entity.script_mapsize_64 != "1" )
{
if ( isDefined( entity.script_mapsize_64 ) && entity.script_mapsize_64 != "1" )
{
entity delete();
}
entity delete();
}
}
i++;
}
}

View File

@ -19,15 +19,18 @@ patch_mp/maps/mp/gametypes/_shellshock.gsc
```
### The following scripts have been checked, but they have not been tested yet
```
patch_mp/maps/mp/gametypes/_callbacksetup.gsc
patch_mp/maps/mp/gametypes/_damagefeedback.gsc
patch_mp/maps/mp/gametypes/_hud.gsc
patch_mp/maps/mp/gametypes/_perplayer.gsc
patch_mp/maps/mp/gametypes/_serversettings.gsc
patch_mp/maps/mp/gametypes/_weapon_utils.gsc
```
### The following scripts are not checked yet, uploaded to setup a baseline:
```
patch_mp/maps/mp/gametypes/_battlechatter.gsc
patch_mp/maps/mp/gametypes/_callbacksetup.gsc
patch_mp/maps/mp/gametypes/_class.gsc
patch_mp/maps/mp/gametypes/_copter.gsc
patch_mp/maps/mp/gametypes/_damagefeedback.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_dev.gsc
patch_mp/maps/mp/gametypes/_dev_class.gsc
@ -45,17 +48,14 @@ patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
patch_mp/maps/mp/gametypes/_healthoverlay.gsc
patch_mp/maps/mp/gametypes/_hostmigration.gsc
patch_mp/maps/mp/gametypes/_hud.gsc
patch_mp/maps/mp/gametypes/_hud_message.gsc
patch_mp/maps/mp/gametypes/_hud_util.gsc
patch_mp/maps/mp/gametypes/_killcam.gsc
patch_mp/maps/mp/gametypes/_menus.gsc
patch_mp/maps/mp/gametypes/_objpoints.gsc
patch_mp/maps/mp/gametypes/_perplayer.gsc
patch_mp/maps/mp/gametypes/_persistence.gsc
patch_mp/maps/mp/gametypes/_pregame.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_serversettings.gsc
patch_mp/maps/mp/gametypes/_spawning.gsc
patch_mp/maps/mp/gametypes/_spawnlogic.gsc
patch_mp/maps/mp/gametypes/_spectating.gsc

View File

@ -5,7 +5,7 @@
#include maps/mp/_audio;
#include maps/mp/_utility;
codecallback_startgametype()
codecallback_startgametype() //checked matches cerberus output
{
if ( !isDefined( level.gametypestarted ) || !level.gametypestarted )
{
@ -14,101 +14,100 @@ codecallback_startgametype()
}
}
codecallback_finalizeinitialization()
codecallback_finalizeinitialization() //checked matches cerberus output
{
maps/mp/_utility::callback( "on_finalize_initialization" );
}
codecallback_playerconnect()
codecallback_playerconnect() //checked matches cerberus output
{
self endon( "disconnect" );
self thread maps/mp/_audio::monitor_player_sprint();
[[ level.callbackplayerconnect ]]();
}
codecallback_playerdisconnect()
codecallback_playerdisconnect() //checked matches cerberus output
{
self notify( "disconnect" );
level notify( "disconnect" );
client_num = self getentitynumber();
[[ level.callbackplayerdisconnect ]]();
}
codecallback_hostmigration()
codecallback_hostmigration() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_HostMigration****" );
#/
*/
[[ level.callbackhostmigration ]]();
}
codecallback_hostmigrationsave()
codecallback_hostmigrationsave() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_HostMigrationSave****" );
#/
*/
[[ level.callbackhostmigrationsave ]]();
}
codecallback_prehostmigrationsave()
{
/#
println( "****CodeCallback_PreHostMigrationSave****" );
#/
[[ level.callbackprehostmigrationsave ]]();
}
codecallback_playermigrated()
codecallback_playermigrated() //checked matches cerberus output
{
/*
/#
println( "****CodeCallback_PlayerMigrated****" );
#/
*/
[[ level.callbackplayermigrated ]]();
}
codecallback_playerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex )
codecallback_playerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerdamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
}
codecallback_playerkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration )
codecallback_playerkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerkilled ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration );
}
codecallback_playerlaststand( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration )
codecallback_playerlaststand( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayerlaststand ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset, deathanimduration );
}
codecallback_playermelee( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit )
codecallback_playermelee( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit ) //checked matches cerberus output
{
self endon( "disconnect" );
[[ level.callbackplayermelee ]]( eattacker, idamage, sweapon, vorigin, vdir, boneindex, shieldhit );
}
codecallback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex )
codecallback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex ) //checked matches cerberus output
{
[[ level.callbackactordamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, boneindex );
}
codecallback_actorkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset )
codecallback_actorkilled( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset ) //checked matches cerberus output
{
[[ level.callbackactorkilled ]]( einflictor, eattacker, idamage, smeansofdeath, sweapon, vdir, shitloc, timeoffset );
}
codecallback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname )
codecallback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname ) //checked matches cerberus output
{
[[ level.callbackvehicledamage ]]( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, timeoffset, damagefromunderneath, modelindex, partname );
}
codecallback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, timeoffset )
codecallback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, timeoffset ) //checked matches cerberus output
{
}
codecallback_faceeventnotify( notify_msg, ent )
codecallback_faceeventnotify( notify_msg, ent ) //checked matches cerberus output
{
if ( isDefined( ent ) && isDefined( ent.do_face_anims ) && ent.do_face_anims )
{
@ -119,7 +118,7 @@ codecallback_faceeventnotify( notify_msg, ent )
}
}
codecallback_menuresponse( action, arg )
codecallback_menuresponse( action, arg ) //checked matches cerberus output
{
if ( !isDefined( level.menuresponsequeue ) )
{
@ -134,18 +133,18 @@ codecallback_menuresponse( action, arg )
level notify( "menuresponse_queue" );
}
menuresponsequeuepump()
menuresponsequeuepump() //checked changed to match cerberus output
{
while ( 1 )
{
level waittill( "menuresponse_queue" );
level.menuresponsequeue[ 0 ].ent notify( "menuresponse" );
level.menuresponsequeue[ 0 ].ent notify( "menuresponse", level.menuresponsequeue[0].action, level.menuresponsequeue[0].arg );
arrayremoveindex( level.menuresponsequeue, 0, 0 );
wait 0,05;
wait 0.05;
}
}
setupcallbacks()
setupcallbacks() //checked matches cerberus output
{
setdefaultcallbacks();
level.idflags_radius = 1;
@ -161,35 +160,36 @@ setupcallbacks()
level.idflags_passthru = 1024;
}
setdefaultcallbacks()
setdefaultcallbacks() //checked matches cerberus output
{
level.callbackstartgametype = ::maps/mp/gametypes_zm/_globallogic::callback_startgametype;
level.callbackplayerconnect = ::maps/mp/gametypes_zm/_globallogic_player::callback_playerconnect;
level.callbackplayerdisconnect = ::maps/mp/gametypes_zm/_globallogic_player::callback_playerdisconnect;
level.callbackplayerdamage = ::maps/mp/gametypes_zm/_globallogic_player::callback_playerdamage;
level.callbackplayerkilled = ::maps/mp/gametypes_zm/_globallogic_player::callback_playerkilled;
level.callbackplayermelee = ::maps/mp/gametypes_zm/_globallogic_player::callback_playermelee;
level.callbackplayerlaststand = ::maps/mp/gametypes_zm/_globallogic_player::callback_playerlaststand;
level.callbackactordamage = ::maps/mp/gametypes_zm/_globallogic_actor::callback_actordamage;
level.callbackactorkilled = ::maps/mp/gametypes_zm/_globallogic_actor::callback_actorkilled;
level.callbackplayermigrated = ::maps/mp/gametypes_zm/_globallogic_player::callback_playermigrated;
level.callbackhostmigration = ::maps/mp/gametypes_zm/_hostmigration::callback_hostmigration;
level.callbackhostmigrationsave = ::maps/mp/gametypes_zm/_hostmigration::callback_hostmigrationsave;
level.callbackprehostmigrationsave = ::maps/mp/gametypes_zm/_hostmigration::callback_prehostmigrationsave;
level.callbackstartgametype = maps/mp/gametypes_zm/_globallogic::callback_startgametype;
level.callbackplayerconnect = maps/mp/gametypes_zm/_globallogic_player::callback_playerconnect;
level.callbackplayerdisconnect = maps/mp/gametypes_zm/_globallogic_player::callback_playerdisconnect;
level.callbackplayerdamage = maps/mp/gametypes_zm/_globallogic_player::callback_playerdamage;
level.callbackplayerkilled = maps/mp/gametypes_zm/_globallogic_player::callback_playerkilled;
level.callbackplayermelee = maps/mp/gametypes_zm/_globallogic_player::callback_playermelee;
level.callbackplayerlaststand = maps/mp/gametypes_zm/_globallogic_player::callback_playerlaststand;
level.callbackactordamage = maps/mp/gametypes_zm/_globallogic_actor::callback_actordamage;
level.callbackactorkilled = maps/mp/gametypes_zm/_globallogic_actor::callback_actorkilled;
level.callbackplayermigrated = maps/mp/gametypes_zm/_globallogic_player::callback_playermigrated;
level.callbackhostmigration = maps/mp/gametypes_zm/_hostmigration::callback_hostmigration;
level.callbackhostmigrationsave = maps/mp/gametypes_zm/_hostmigration::callback_hostmigrationsave;
}
abortlevel()
abortlevel() //checked matches cerberus output
{
/*
/#
println( "ERROR: Aborting level - gametype is not supported" );
#/
*/
level.callbackstartgametype = ::callbackvoid;
level.callbackplayerconnect = ::callbackvoid;
level.callbackplayerdisconnect = ::callbackvoid;
level.callbackplayerdamage = ::callbackvoid;
level.callbackplayerkilled = ::callbackvoid;
level.callbackplayermelee = ::callbackvoid;
level.callbackplayerlaststand = ::callbackvoid;
level.callbackplayermelee = ::callbackvoid;
level.callbackactordamage = ::callbackvoid;
level.callbackactorkilled = ::callbackvoid;
level.callbackvehicledamage = ::callbackvoid;
@ -197,11 +197,13 @@ abortlevel()
exitlevel( 0 );
}
codecallback_glasssmash( pos, dir )
codecallback_glasssmash( pos, dir ) //checked matches cerberus output
{
level notify( "glass_smash" );
}
callbackvoid()
callbackvoid() //checked matches cerberus output
{
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
precacheshader( "damage_feedback" );
precacheshader( "damage_feedback_flak" );
@ -7,7 +7,7 @@ init()
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -24,7 +24,7 @@ onplayerconnect()
}
}
updatedamagefeedback( mod, inflictor, perkfeedback )
updatedamagefeedback( mod, inflictor, perkfeedback ) //checked matches cerberus output
{
if ( !isplayer( self ) || sessionmodeiszombiesgame() )
{
@ -37,7 +37,7 @@ updatedamagefeedback( mod, inflictor, perkfeedback )
switch( inflictor.soundmod )
{
case "player":
self thread playhitsound( mod, "mpl_hit_alert" );
self playlocalsound( "mpl_hit_alert" );
break;
case "heli":
self thread playhitsound( mod, "mpl_hit_alert_air" );
@ -58,7 +58,10 @@ updatedamagefeedback( mod, inflictor, perkfeedback )
break;
}
}
else self thread playhitsound( mod, "mpl_hit_alert_low" );
else
{
self playlocalsound( "mpl_hit_alert_low" );
}
}
if ( isDefined( perkfeedback ) )
{
@ -79,19 +82,19 @@ updatedamagefeedback( mod, inflictor, perkfeedback )
}
}
playhitsound( mod, alert )
playhitsound( mod, alert ) //checked matches cerberus output
{
self endon( "disconnect" );
if ( self.hitsoundtracker )
{
self.hitsoundtracker = 0;
self playlocalsound( alert );
wait 0,05;
wait 0.05;
self.hitsoundtracker = 1;
}
}
updatespecialdamagefeedback( hitent )
updatespecialdamagefeedback( hitent ) //checked matches cerberus output
{
if ( !isplayer( self ) )
{
@ -105,7 +108,7 @@ updatespecialdamagefeedback( hitent )
{
return;
}
wait 0,05;
wait 0.05;
if ( !isDefined( self.directionalhitarray ) )
{
self.directionalhitarray = [];
@ -120,15 +123,14 @@ updatespecialdamagefeedback( hitent )
}
}
sendhitspecialeventatframeend( hitent )
sendhitspecialeventatframeend( hitent ) //checked changed to match cerberus output
{
self endon( "disconnect" );
waittillframeend;
enemyshit = 0;
value = 1;
entbitarray0 = 0;
i = 0;
while ( i < 32 )
for ( i = 0; i < 32; i++ )
{
if ( isDefined( self.directionalhitarray[ i ] ) && self.directionalhitarray[ i ] != 0 )
{
@ -136,11 +138,9 @@ sendhitspecialeventatframeend( hitent )
enemyshit++;
}
value *= 2;
i++;
}
entbitarray1 = 0;
i = 33;
while ( i < 64 )
for ( i = 33; i < 64; i++ )
{
if ( isDefined( self.directionalhitarray[ i ] ) && self.directionalhitarray[ i ] != 0 )
{
@ -148,7 +148,6 @@ sendhitspecialeventatframeend( hitent )
enemyshit++;
}
value *= 2;
i++;
}
if ( enemyshit )
{
@ -158,3 +157,4 @@ sendhitspecialeventatframeend( hitent )
entbitarray0 = 0;
entbitarray1 = 0;
}

View File

@ -1,5 +1,5 @@
init()
init() //checked changed to match cerberus output
{
precacheshader( "progress_bar_bg" );
precacheshader( "progress_bar_fg" );
@ -16,13 +16,9 @@ init()
level.uiparent.height = 0;
level.uiparent.children = [];
level.fontheight = 12;
_a103 = level.teams;
_k103 = getFirstArrayKey( _a103 );
while ( isDefined( _k103 ) )
foreach ( team in level.teams )
{
team = _a103[ _k103 ];
level.hud[ team ] = spawnstruct();
_k103 = getNextArrayKey( _a103, _k103 );
}
level.primaryprogressbary = -61;
level.primaryprogressbarx = 0;
@ -30,7 +26,7 @@ init()
level.primaryprogressbarwidth = 120;
level.primaryprogressbartexty = -75;
level.primaryprogressbartextx = 0;
level.primaryprogressbarfontsize = 1,4;
level.primaryprogressbarfontsize = 1.4;
level.primaryprogressbarx_ss = 20;
level.primaryprogressbartextx_ss = 20;
level.primaryprogressbary_ss = 30;
@ -42,7 +38,7 @@ init()
level.secondaryprogressbarwidth = 120;
level.secondaryprogressbartexty = -100;
level.secondaryprogressbartextx = 0;
level.secondaryprogressbarfontsize = 1,4;
level.secondaryprogressbarfontsize = 1.4;
level.secondaryprogressbarx_ss = 20;
level.secondaryprogressbartextx_ss = 20;
level.secondaryprogressbary_ss = 15;
@ -52,25 +48,25 @@ init()
level.teamprogressbarheight = 14;
level.teamprogressbarwidth = 192;
level.teamprogressbartexty = 8;
level.teamprogressbarfontsize = 1,65;
setdvar( "ui_generic_status_bar", 0 );
level.teamprogressbarfontsize = 1.65;
setdvar("ui_generic_status_bar", 0);
level.lowertextyalign = "BOTTOM";
level.lowertexty = -42;
level.lowertextfontsize = 1,4;
level.lowertextfontsize = 1.4;
level.lowertextyalign_ss = "CENTER";
level.lowertexty_ss = 40;
level.lowertextfontsize_ss = 1,4;
level.lowertextfontsize_ss = 1.4;
}
fontpulseinit()
fontpulseinit() //checked matches cerberus output
{
self.basefontscale = self.fontscale;
self.maxfontscale = self.fontscale * 2;
self.inframes = 1,5;
self.inframes = 1.5;
self.outframes = 3;
}
fontpulse( player )
fontpulse( player ) //checked matches cerberus output
{
self notify( "fontPulse" );
self endon( "fontPulse" );
@ -80,7 +76,7 @@ fontpulse( player )
player endon( "joined_spectators" );
if ( self.outframes == 0 )
{
self.fontscale = 0,01;
self.fontscale = 0.01;
}
else
{
@ -88,30 +84,26 @@ fontpulse( player )
}
if ( self.inframes > 0 )
{
self changefontscaleovertime( self.inframes * 0,05 );
self changefontscaleovertime( self.inframes * 0.05 );
self.fontscale = self.maxfontscale;
wait ( self.inframes * 0,05 );
wait ( self.inframes * 0.05 );
}
else
{
self.fontscale = self.maxfontscale;
self.alpha = 0;
self fadeovertime( self.outframes * 0,05 );
self fadeovertime( self.outframes * 0.05 );
self.alpha = 1;
}
if ( self.outframes > 0 )
{
self changefontscaleovertime( self.outframes * 0,05 );
self changefontscaleovertime( self.outframes * 0.05 );
self.fontscale = self.basefontscale;
}
}
fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadername, n_sort )
fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadername ) //checked matches cerberus output
{
if ( !isDefined( n_sort ) )
{
n_sort = 50;
}
wait startwait;
if ( !isDefined( self ) )
{
@ -128,7 +120,8 @@ fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadern
self.blackscreen.foreground = 0;
self.blackscreen.hidewhendead = 0;
self.blackscreen.hidewheninmenu = 1;
self.blackscreen.sort = n_sort;
self.blackscreen.immunetodemogamehudsettings = 1;
self.blackscreen.sort = 50;
if ( isDefined( shadername ) )
{
self.blackscreen setshader( shadername, 640, 480 );
@ -165,3 +158,4 @@ fadetoblackforxsec( startwait, blackscreenwait, fadeintime, fadeouttime, shadern
self.blackscreen = undefined;
}
}

View File

@ -1,6 +1,6 @@
#include maps/mp/_utility;
init( id, playerbegincallback, playerendcallback )
init( id, playerbegincallback, playerendcallback ) //checked matches cerberus output
{
precacheshader( "objpoint_default" );
handler = spawnstruct();
@ -14,7 +14,7 @@ init( id, playerbegincallback, playerendcallback )
return handler;
}
enable( handler )
enable( handler ) //checked partially changed to match cerberus output didn't change while loop to for loop to prevent infinite loop continue bug
{
if ( handler.enabled )
{
@ -23,11 +23,9 @@ enable( handler )
handler.enabled = 1;
level.handlerglobalflagval++;
players = get_players();
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
players[ i ].handlerflagval = level.handlerglobalflagval;
i++;
}
players = handler.players;
i = 0;
@ -38,18 +36,15 @@ enable( handler )
i++;
continue;
}
else
if ( players[ i ].handlers[ handler.id ].ready )
{
if ( players[ i ].handlers[ handler.id ].ready )
{
players[ i ] handleplayer( handler );
}
players[ i ] handleplayer( handler );
}
i++;
}
}
disable( handler )
disable( handler ) //checked partially changed to match cerberus output didn't change while loop to for loop to prevent infinite loop continue bug
{
if ( !handler.enabled )
{
@ -58,11 +53,9 @@ disable( handler )
handler.enabled = 0;
level.handlerglobalflagval++;
players = get_players();
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
players[ i ].handlerflagval = level.handlerglobalflagval;
i++;
}
players = handler.players;
i = 0;
@ -73,18 +66,15 @@ disable( handler )
i++;
continue;
}
else
if ( players[ i ].handlers[ handler.id ].ready )
{
if ( players[ i ].handlers[ handler.id ].ready )
{
players[ i ] unhandleplayer( handler, 0, 0 );
}
players[ i ] unhandleplayer( handler, 0, 0 );
}
i++;
}
}
onplayerconnect( handler )
onplayerconnect( handler ) //checked matches cerberus output
{
for ( ;; )
{
@ -106,24 +96,22 @@ onplayerconnect( handler )
}
}
onplayerdisconnect( handler )
onplayerdisconnect( handler ) //checked changed to match cerberus output
{
self waittill( "disconnect" );
newplayers = [];
i = 0;
while ( i < handler.players.size )
for ( i = 0; i < handler.players.size; i++ )
{
if ( handler.players[ i ] != self )
{
newplayers[ newplayers.size ] = handler.players[ i ];
}
i++;
}
handler.players = newplayers;
self thread unhandleplayer( handler, 1, 1 );
}
onjoinedteam( handler )
onjoinedteam( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -133,7 +121,7 @@ onjoinedteam( handler )
}
}
onjoinedspectators( handler )
onjoinedspectators( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -143,7 +131,7 @@ onjoinedspectators( handler )
}
}
onplayerspawned( handler )
onplayerspawned( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -153,7 +141,7 @@ onplayerspawned( handler )
}
}
onplayerkilled( handler )
onplayerkilled( handler ) //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -163,7 +151,7 @@ onplayerkilled( handler )
}
}
handleplayer( handler )
handleplayer( handler ) //checked matches cerberus output
{
self.handlers[ handler.id ].ready = 1;
if ( !handler.enabled )
@ -178,7 +166,7 @@ handleplayer( handler )
self thread [[ handler.playerbegincallback ]]();
}
unhandleplayer( handler, unsetready, disconnected )
unhandleplayer( handler, unsetready, disconnected ) //checked matches cerberus output
{
if ( !disconnected && unsetready )
{
@ -194,3 +182,4 @@ unhandleplayer( handler, unsetready, disconnected )
}
self thread [[ handler.playerendcallback ]]( disconnected );
}

View File

@ -1,5 +1,5 @@
init()
init() //checked matches cerberus output
{
level.hostname = getDvar( "sv_hostname" );
if ( level.hostname == "" )
@ -64,7 +64,7 @@ init()
}
}
updateserversettings()
updateserversettings() //checked matches cerberus output
{
sv_hostname = getDvar( "sv_hostname" );
if ( level.hostname != sv_hostname )
@ -92,7 +92,7 @@ updateserversettings()
}
}
constraingametype( gametype )
constraingametype( gametype ) //checked partially changed to match cerberus output did not change while loop to for for loop because of infinite loop caused by continues
{
entities = getentarray();
i = 0;
@ -108,7 +108,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "tdm" )
if ( gametype == "tdm" )
{
if ( isDefined( entity.script_gametype_tdm ) && entity.script_gametype_tdm != "1" )
{
@ -117,7 +117,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "ctf" )
if ( gametype == "ctf" )
{
if ( isDefined( entity.script_gametype_ctf ) && entity.script_gametype_ctf != "1" )
{
@ -126,7 +126,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "hq" )
if ( gametype == "hq" )
{
if ( isDefined( entity.script_gametype_hq ) && entity.script_gametype_hq != "1" )
{
@ -135,7 +135,7 @@ constraingametype( gametype )
i++;
continue;
}
else if ( gametype == "sd" )
if ( gametype == "sd" )
{
if ( isDefined( entity.script_gametype_sd ) && entity.script_gametype_sd != "1" )
{
@ -144,21 +144,18 @@ constraingametype( gametype )
i++;
continue;
}
else
if ( gametype == "koth" )
{
if ( gametype == "koth" )
if ( isDefined( entity.script_gametype_koth ) && entity.script_gametype_koth != "1" )
{
if ( isDefined( entity.script_gametype_koth ) && entity.script_gametype_koth != "1" )
{
entity delete();
}
entity delete();
}
}
i++;
}
}
constrainmapsize( mapsize )
constrainmapsize( mapsize ) //checked partially changed to match cerberus output did not change while loop to for for loop because of infinite loop caused by continues
{
entities = getentarray();
i = 0;
@ -174,7 +171,7 @@ constrainmapsize( mapsize )
i++;
continue;
}
else if ( int( mapsize ) == 16 )
if ( int( mapsize ) == 16 )
{
if ( isDefined( entity.script_mapsize_16 ) && entity.script_mapsize_16 != "1" )
{
@ -183,7 +180,7 @@ constrainmapsize( mapsize )
i++;
continue;
}
else if ( int( mapsize ) == 32 )
if ( int( mapsize ) == 32 )
{
if ( isDefined( entity.script_mapsize_32 ) && entity.script_mapsize_32 != "1" )
{
@ -192,16 +189,14 @@ constrainmapsize( mapsize )
i++;
continue;
}
else
if ( int( mapsize ) == 64 )
{
if ( int( mapsize ) == 64 )
if ( isDefined( entity.script_mapsize_64 ) && entity.script_mapsize_64 != "1" )
{
if ( isDefined( entity.script_mapsize_64 ) && entity.script_mapsize_64 != "1" )
{
entity delete();
}
entity delete();
}
}
i++;
}
}

View File

@ -48,6 +48,11 @@ patch_zm/maps/mp/zombies/_zm_pers_upgrades_functions.gsc
```
### The following scripts have been checked, but they have not been tested yet
```
patch_zm/maps/mp/gametypes_zm/_callbacksetup.gsc
patch_zm/maps/mp/gametypes_zm/_damagefeedback.gsc
patch_zm/maps/mp/gametypes_zm/_hud.gsc
patch_zm/maps/mp/gametypes_zm/_perplayer.gsc
patch_zm/maps/mp/gametypes_zm/_serversettings.gsc
patch_zm/maps/mp/gametypes_zm/_weapon_utils.gsc
patch_zm/maps/mp/zombies/_zm_blockers.gsc
patch_zm/maps/mp/zombies/_zm_buildables.gsc
@ -66,8 +71,6 @@ patch_zm/maps/mp/zombies/_zm_weap_cymbal_monkey.gsc
```
### The following scripts are not checked yet, uploaded to setup a baseline:
```
patch_zm/maps/mp/gametypes_zm/_callbacksetup.gsc
patch_zm/maps/mp/gametypes_zm/_damagefeedback.gsc
patch_zm/maps/mp/gametypes_zm/_dev.gsc
patch_zm/maps/mp/gametypes_zm/_gameobjects.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic.gsc
@ -83,12 +86,9 @@ patch_zm/maps/mp/gametypes_zm/_globallogic_vehicle.gsc
patch_zm/maps/mp/gametypes_zm/_gv_actions.gsc
patch_zm/maps/mp/gametypes_zm/_healthoverlay.gsc
patch_zm/maps/mp/gametypes_zm/_hostmigration.gsc
patch_zm/maps/mp/gametypes_zm/_hud.gsc
patch_zm/maps/mp/gametypes_zm/_hud_message.gsc
patch_zm/maps/mp/gametypes_zm/_hud_util.gsc
patch_zm/maps/mp/gametypes_zm/_menus.gsc
patch_zm/maps/mp/gametypes_zm/_perplayer.gsc
patch_zm/maps/mp/gametypes_zm/_serversettings.gsc
patch_zm/maps/mp/gametypes_zm/_spawning.gsc
patch_zm/maps/mp/gametypes_zm/_spawnlogic.gsc
patch_zm/maps/mp/gametypes_zm/_spectating.gsc