Skip to content

Commit

Permalink
fix -1 CN arg in PLAYER_VARGS_ICOMMAND
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Jan 24, 2021
1 parent 4dbad0a commit 1e2ca75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patches/scoreboard.patch
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ Index: src/fpsgame/weaponstats.h
+ extern float playeraccuracy(fpsent *p, int gun = -1);
+
+ #define PLAYER_VARGS_ICOMMAND(name,b) ICOMMAND(name, "V", (tagval *args, int numargs), { \
+ fpsent *p = numargs > 0 ? getclient(args[0].getint()) : hudplayer(); \
+ fpsent *p = (numargs > 0 && args[0].getint() != -1) ? getclient(args[0].getint()) : hudplayer(); \
+ if(!p) { conoutf("\f6no player with CN %d", args[0].getint()); return; } \
+ b; \
+ })
Expand Down
2 changes: 1 addition & 1 deletion src/fpsgame/weaponstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace game {
extern float playeraccuracy(fpsent *p, int gun = -1);

#define PLAYER_VARGS_ICOMMAND(name,b) ICOMMAND(name, "V", (tagval *args, int numargs), { \
fpsent *p = numargs > 0 ? getclient(args[0].getint()) : hudplayer(); \
fpsent *p = (numargs > 0 && args[0].getint() != -1) ? getclient(args[0].getint()) : hudplayer(); \
if(!p) { conoutf("\f6no player with CN %d", args[0].getint()); return; } \
b; \
})
Expand Down

0 comments on commit 1e2ca75

Please sign in to comment.