MCPcopy Create free account
hub / github.com/diasurgical/devilution / ProcessPlayers

Function ProcessPlayers

Source/player.cpp:3411–3507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3409}
3410
3411void ProcessPlayers()
3412{
3413 int pnum;
3414 BOOL tplayer;
3415
3416 if ((DWORD)myplr >= MAX_PLRS) {
3417 app_fatal("ProcessPlayers: illegal player %d", myplr);
3418 }
3419
3420 if (plr[myplr].pLvlLoad > 0) {
3421 plr[myplr].pLvlLoad--;
3422 }
3423
3424 if (sfxdelay > 0) {
3425 sfxdelay--;
3426 if (sfxdelay == 0) {
3427 PlaySFX(sfxdnum);
3428 }
3429 }
3430
3431 ValidatePlayer();
3432
3433 for (pnum = 0; pnum < MAX_PLRS; pnum++) {
3434 if (plr[pnum].plractive && currlevel == plr[pnum].plrlevel && (pnum == myplr || !plr[pnum]._pLvlChanging)) {
3435 CheckCheatStats(pnum);
3436
3437 if (!PlrDeathModeOK(pnum) && (plr[pnum]._pHitPoints >> 6) <= 0) {
3438 SyncPlrKill(pnum, -1);
3439 }
3440
3441 if (pnum == myplr) {
3442 if ((plr[pnum]._pIFlags & ISPL_DRAINLIFE) && currlevel != 0) {
3443 plr[pnum]._pHitPoints -= 4;
3444 plr[pnum]._pHPBase -= 4;
3445 if ((plr[pnum]._pHitPoints >> 6) <= 0) {
3446 SyncPlrKill(pnum, 0);
3447 }
3448 drawhpflag = TRUE;
3449 }
3450 if (plr[pnum]._pIFlags & ISPL_NOMANA && plr[pnum]._pManaBase > 0) {
3451 plr[pnum]._pManaBase -= plr[pnum]._pMana;
3452 plr[pnum]._pMana = 0;
3453 drawmanaflag = TRUE;
3454 }
3455 }
3456
3457 tplayer = FALSE;
3458 do {
3459 switch (plr[pnum]._pmode) {
3460 case PM_STAND:
3461 tplayer = PM_DoStand(pnum);
3462 break;
3463 case PM_WALK:
3464 tplayer = PM_DoWalk(pnum);
3465 break;
3466 case PM_WALK2:
3467 tplayer = PM_DoWalk2(pnum);
3468 break;

Callers 1

game_logicFunction · 0.85

Calls 15

app_fatalFunction · 0.85
PlaySFXFunction · 0.85
ValidatePlayerFunction · 0.85
CheckCheatStatsFunction · 0.85
PlrDeathModeOKFunction · 0.85
SyncPlrKillFunction · 0.85
PM_DoStandFunction · 0.85
PM_DoWalkFunction · 0.85
PM_DoWalk2Function · 0.85
PM_DoWalk3Function · 0.85
PM_DoAttackFunction · 0.85
PM_DoRangeAttackFunction · 0.85

Tested by

no test coverage detected