diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 69434059..93a3ea00 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -620,6 +620,9 @@ void flagmsg(int flag, int action) } } +void dropflag() { tryflagdrop(false); } +COMMAND(dropflag, ARG_NONE); + votedisplayinfo *newvotedisplayinfo(playerent *owner, int type, char *arg1, char *arg2) { if(type < 0 || type >= SA_NUM) return NULL; diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 538148ed..78ffd99f 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -316,8 +316,11 @@ bool intersect(entity *e, vec &from, vec &to, vec *end) // if lineseg hits entit // flag ent actions done by the local player +int flagdropmillis = 0; + void flagpickup() { + if(flagdropmillis && flagdropmillis>lastmillis) return; flaginfo &f = flaginfos[team_opposite(team_int(player1->team))]; f.flag->spawned = false; f.state = CTFF_STOLEN; @@ -335,6 +338,7 @@ void tryflagdrop(bool reset) f.flag->spawned = false; f.state = CTFF_DROPPED; f.ack = false; + flagdropmillis = lastmillis+1000; addmsg(reset ? SV_FLAGRESET : SV_FLAGDROP, "ri", f.team); } }