EDUKE32_STANDALONE guard some HoloDuke behavior in CON_IFCANSEE and remove a branch from GAMEARRAY_BITMAP processing in CON_SETARRAY

git-svn-id: https://svn.eduke32.com/eduke32@6818 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-04-06 01:43:12 +00:00
parent bcd5e48c8c
commit 260fb278d9

View file

@ -1453,6 +1453,7 @@ skip_check:
// select sprite for monster to target // select sprite for monster to target
// if holoduke is on, let them target holoduke first. // if holoduke is on, let them target holoduke first.
// //
#ifndef EDUKE32_STANDALONE
if (pPlayer->holoduke_on >= 0) if (pPlayer->holoduke_on >= 0)
{ {
pSprite = (uspritetype *)&sprite[pPlayer->holoduke_on]; pSprite = (uspritetype *)&sprite[pPlayer->holoduke_on];
@ -1466,7 +1467,7 @@ skip_check:
pSprite = (uspritetype *)&sprite[pPlayer->i]; pSprite = (uspritetype *)&sprite[pPlayer->i];
} }
} }
#endif
// can they see player, (or player's holoduke) // can they see player, (or player's holoduke)
tw = cansee(vm.pSprite->x,vm.pSprite->y,vm.pSprite->z-(krand()&((47<<8))),vm.pSprite->sectnum, tw = cansee(vm.pSprite->x,vm.pSprite->y,vm.pSprite->z-(krand()&((47<<8))),vm.pSprite->sectnum,
pSprite->x,pSprite->y,pSprite->z-(24<<8),pSprite->sectnum); pSprite->x,pSprite->y,pSprite->z-(24<<8),pSprite->sectnum);
@ -4520,12 +4521,13 @@ finish_qsprintf:
case GAMEARRAY_UINT16: ((uint16_t *) aGameArrays[tw].pValues)[arrayIndex] = newValue; break; case GAMEARRAY_UINT16: ((uint16_t *) aGameArrays[tw].pValues)[arrayIndex] = newValue; break;
case GAMEARRAY_UINT8: ((int8_t *) aGameArrays[tw].pValues)[arrayIndex] = newValue; break; case GAMEARRAY_UINT8: ((int8_t *) aGameArrays[tw].pValues)[arrayIndex] = newValue; break;
case GAMEARRAY_BITMAP: case GAMEARRAY_BITMAP:
if (newValue) {
((uint8_t *)aGameArrays[tw].pValues)[arrayIndex >> 3] |= (1 << (arrayIndex & 7)); uint32_t const mask = (1 << (arrayIndex & 7));
else uint8_t & value = ((uint8_t *)aGameArrays[tw].pValues)[arrayIndex >> 3];
((uint8_t *)aGameArrays[tw].pValues)[arrayIndex >> 3] &= ~(1 << (arrayIndex & 7)); value = (value & ~mask) | (-!!newValue & mask);
break; break;
} }
}
continue; continue;
} }