Skip to content

Commit

Permalink
MP: Fix G2 AddBolt API returning inconsistent result
Browse files Browse the repository at this point in the history
In original game if the g2 pointer/ref was invalid it would return -1.  In the new modules it seems to have changed to returning to 0 here causing an inconsistency.  UI already returns -1 properly but cgame and server did not.
  • Loading branch information
ensiform committed Mar 25, 2018
1 parent dd3a1c8 commit b48f71e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion codemp/client/cl_cgameapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static int CL_G2API_Ghoul2Size( void *ghlInfo ) {
}

static int CL_G2API_AddBolt( void *ghoul2, int modelIndex, const char *boneName ) {
if ( !ghoul2 ) return 0;
if ( !ghoul2 ) return -1;
return re->G2API_AddBolt( *((CGhoul2Info_v *)ghoul2), modelIndex, boneName );
}

Expand Down
2 changes: 1 addition & 1 deletion codemp/server/sv_gameapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ static int SV_G2API_Ghoul2Size( void *ghlInfo ) {
}

static int SV_G2API_AddBolt( void *ghoul2, int modelIndex, const char *boneName ) {
if ( !ghoul2 ) return 0;
if ( !ghoul2 ) return -1;
return re->G2API_AddBolt( *((CGhoul2Info_v *)ghoul2), modelIndex, boneName );
}

Expand Down

0 comments on commit b48f71e

Please sign in to comment.