MCPcopy Create free account
hub / github.com/assaultcube/AC / flagpickup

Function flagpickup

source/src/entities.cpp:480–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478int flagdropmillis = 0;
479
480void flagpickup(int fln)
481{
482 if(flagdropmillis && flagdropmillis>lastmillis) return;
483 flaginfo &f = flaginfos[fln];
484 int action = f.state == CTFF_INBASE ? FA_STEAL : FA_PICKUP;
485 f.flagent->spawned = false;
486 f.state = CTFF_STOLEN;
487 f.actor = player1; // do this although we don't know if we picked the flag to avoid getting it after a possible respawn
488 f.actor_cn = getclientnum();
489 f.ack = false;
490 addmsg(SV_FLAGACTION, "rii", action, f.team);
491}
492
493void tryflagdrop(bool manual)
494{

Callers 1

trypickupflagFunction · 0.85

Calls 2

getclientnumFunction · 0.85
addmsgFunction · 0.85

Tested by

no test coverage detected