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

Function trypickup

source/src/entities.cpp:334–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332extern int lastspawn;
333
334void trypickup(int n, playerent *d)
335{
336 entity &e = ents[n];
337 switch(e.type)
338 {
339 default:
340 if( d->canpickup(e.type) && lastmillis > e.lastmillis + 250 && lastmillis > lastspawn + 500 )
341 {
342 if(d->type==ENT_PLAYER) addmsg(SV_ITEMPICKUP, "ri", n);
343 else if(d->type==ENT_BOT && serverpickup(n, -1)) pickupeffects(n, d);
344 e.lastmillis = lastmillis;
345 }
346 break;
347
348 case LADDER:
349 if(!d->crouching) d->onladder = true;
350 break;
351 }
352}
353
354void trypickupflag(int flag, playerent *d)
355{

Callers 1

loopvFunction · 0.85

Calls 4

addmsgFunction · 0.85
serverpickupFunction · 0.85
pickupeffectsFunction · 0.85
canpickupMethod · 0.80

Tested by

no test coverage detected