Skip to content

Commit ce919d4

Browse files
committed
fix i arr access
1 parent 3d1ee7b commit ce919d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/game/server/swarm/asw_concommands.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,20 +2145,20 @@ void set_spectate_marine_order( const CCommand &args )
21452145
int8_t iProfiles[ASW_NUM_MARINE_PROFILES];
21462146

21472147
// parse input
2148-
for ( size_t i = 1; i <= ASW_NUM_MARINE_PROFILES; i++ )
2148+
for ( size_t i = 0; i < ASW_NUM_MARINE_PROFILES; i++ )
21492149
{
2150-
const int iProfile = atoi( args[i] );
2150+
const int iProfile = atoi( args[i + 1] );
21512151

21522152
if ( iProfile < 0 || iProfile >= ASW_NUM_MARINE_PROFILES )
21532153
{
2154-
Warning( "marine_order: Incorrect profile number (#%d: %s)\n", i, args[i] );
2154+
Warning( "marine_order: Incorrect profile number (#%d: %s)\n", i + 1, args[i + 1] );
21552155
return;
21562156
}
21572157

21582158
for ( size_t j = 0; j < i; j++ ){
21592159
if ( iProfiles[j] == iProfile )
21602160
{
2161-
Warning( "marine_order: Double profile number (%d: %d)\n", i, iProfile );
2161+
Warning( "marine_order: Double profile number (%d: %d)\n", i + 1, iProfile );
21622162
return;
21632163
}
21642164
}

0 commit comments

Comments
 (0)