diff --git a/.gitea/scripts/clean.py b/.gitea/scripts/clean.py index 8c48d1c..29e7be2 100644 --- a/.gitea/scripts/clean.py +++ b/.gitea/scripts/clean.py @@ -4,6 +4,7 @@ def erase_commented_lines(filename, out): with open(filename, 'r') as file: lines = file.readlines() + # gcc leaves these "comments" at the start of the file lines = [line for line in lines if not line.startswith('#')] with open(out, 'w') as file: diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 98bf743..b593004 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - name: Create release run: | - bash -e .gitea/scripts/ci.sh + ./.gitea/scripts/ci.sh - name: Upload release uses: actions/upload-artifact@v3 diff --git a/iw4/scripts/mp/_jump.gsc b/iw4/scripts/mp/_jump.gsc index 483c4a9..fb8c468 100644 --- a/iw4/scripts/mp/_jump.gsc +++ b/iw4/scripts/mp/_jump.gsc @@ -3,6 +3,7 @@ init() { setDvar( "bg_bounces", 1 ); + setDvar( "player_sustainAmmo", 1 ); // Requires sv_cheats thread onPlayerConnect(); } @@ -33,7 +34,7 @@ onPlayerSpawned() { self endon( "disconnect" ); - for ( ;; ) + while ( true ) { self waittill( "spawned_player" ); @@ -57,7 +58,7 @@ onWeaponFired() level endon( "game_ended" ); self endon( "disconnected" ); - for ( ;; ) + while ( true ) { self waittill( "weapon_fired", weapon ); @@ -92,7 +93,7 @@ displaySpeed() if ( isDefined( self.last_rpg_shot ) && self.last_rpg_shot != 0 ) { late = getTime() - self.last_rpg_shot; - if (late < 500) + if (late <= 500) { iPrintLn( "Late RPG (+" + (late) + ")" ); } diff --git a/iw5/scripts/mp/_jump.gsc b/iw5/scripts/mp/_jump.gsc index ef9c708..f8d9db4 100644 --- a/iw5/scripts/mp/_jump.gsc +++ b/iw5/scripts/mp/_jump.gsc @@ -19,6 +19,7 @@ _ON_PLAYER_CNCT_BEGIN PLAYER_NOTIFY_CMD( player, "save_pos", "+reload" ); PLAYER_NOTIFY_CMD( player, "load_saved_pos", "+activate" ); + player thread onWeaponFired(); player thread jumper(); player thread displaySpeed(); @@ -26,6 +27,21 @@ _ON_PLAYER_CNCT_BEGIN _ON_PLAYER_CNCT_END +onWeaponFired() +{ + GENERIC_COROUTINE_END + + while ( true ) + { + self waittill( "weapon_fired", weapon ); + + if (weapon == "rpg_mp") + { + self.last_rpg_shot = getTime(); + } + } +} + displaySpeed() { GENERIC_COROUTINE_END; @@ -36,12 +52,30 @@ displaySpeed() self.speed_text.label = &""; self.last_speed_sample = 0; + self.last_z_coordinate = 0.0; while ( true ) { player_speed = distance( ZERO_VEC3, self getvelocity() ); current_speed = int( player_speed ); + if ( self.origin[2] > self.last_z_coordinate ) + { + // We should be going up + if ( isDefined( self.last_rpg_shot ) && self.last_rpg_shot != 0 ) + { + late = getTime() - self.last_rpg_shot; + if (late <= 500) + { + iPrintLn( "Late RPG (+" + (late) + ")" ); + } + + self.last_rpg_shot = 0; + } + } + + self.last_z_coordinate = self.origin[2]; + if ( self.last_speed_sample == current_speed ) { // White diff --git a/iw5/scripts/mp/_utility.gsh b/iw5/scripts/mp/_utility.gsh index 995d5a6..4cb2d24 100644 --- a/iw5/scripts/mp/_utility.gsh +++ b/iw5/scripts/mp/_utility.gsh @@ -48,6 +48,7 @@ init() \ { \ setDvar( BOUNCES_DVAR, 1 ); \ + setDvar( "player_sustainAmmo", 1 ); \ thread onPlayerConnect(); \ }