Skip to content

Commit

Permalink
Added Selbie's resetClientCommand as resetNextReliableTime (cod2)
Browse files Browse the repository at this point in the history
  • Loading branch information
M-itch committed Jan 16, 2015
1 parent a126366 commit 2087245
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions gsc.cpp
Expand Up @@ -319,6 +319,7 @@ Scr_Method scriptMethods[] = {
{"connectionlessPacket" , gsc_player_connectionlesspacket, 0},
{"allow_rename" , gsc_player_allow_rename , 0},
{"clientuserinfochanged" , gsc_player_clientuserinfochanged, 0},
{"resetNextReliableTime" , gsc_player_resetNextReliableTime, 0},
#endif

{NULL, NULL, 0}
Expand Down
13 changes: 13 additions & 0 deletions gsc_player.cpp
Expand Up @@ -548,6 +548,19 @@ void gsc_player_connectionlesspacket(int id) {
stackReturnInt(1);
}

void gsc_player_resetNextReliableTime(int id)
{
#if COD_VERSION == COD2_1_0
int offset = 134412;
#else
int offset = 134684;
#endif

*(int *)(PLAYERBASE(id) + offset) = 0;
stackPushInt(0);
}


// entity functions (could be in own file, but atm not many pure entity functions)

void gsc_entity_setalive(int id) { // as in isAlive?
Expand Down
1 change: 1 addition & 0 deletions gsc_player.hpp
Expand Up @@ -48,6 +48,7 @@ void gsc_player_addresstype(int id);
void gsc_player_renamebot(int id);
void gsc_player_outofbandprint(int id);
void gsc_player_connectionlesspacket(int id);
void gsc_player_resetNextReliableTime(int id);

// entity functions
void gsc_entity_setalive(int id);
Expand Down

0 comments on commit 2087245

Please sign in to comment.