@@ -985,11 +985,11 @@ Item *Item::getRandomWeapon(const char *typeName,ItemClass itemClass) {
985985 switch (modType) {
986986 case MOD_RELOAD :
987987 weapon->reloadDelay -= rng->getFloat (0 .05f , MAX_RELOAD_BONUS);
988- weapon->reloadDelay = MAX (0 .1f ,weapon->reloadDelay );
988+ weapon->reloadDelay = std::max (0 .1f ,weapon->reloadDelay );
989989 break ;
990990 case MOD_CAST :
991991 weapon->castDelay -= rng->getFloat (0 .05f , MAX_CAST_BONUS);
992- weapon->castDelay = MAX (0 .1f ,weapon->reloadDelay );
992+ weapon->castDelay = std::max (0 .1f ,weapon->reloadDelay );
993993 break ;
994994 case MOD_MODIFIER :
995995 ItemModifierId id=(ItemModifierId)0 ;
@@ -1007,7 +1007,7 @@ Item *Item::getRandomWeapon(const char *typeName,ItemClass itemClass) {
10071007 }
10081008 }
10091009 weapon->damages += weapon->damages * (int )(itemClass)*0 .2f ; // 20% increase per color level
1010- weapon->damages = MIN (1 .0f ,weapon->damages );
1010+ weapon->damages = std::min (1 .0f ,weapon->damages );
10111011 // build components
10121012 weapon->generateComponents ();
10131013 return weapon;
@@ -1308,8 +1308,8 @@ void Item::renderGenericDescription(int x, int y, bool below, bool frame) {
13081308 float maxDamages = 15 * (featAttack->maxCastDelay + featAttack->maxReloadDelay ) * featAttack->maxDamagesCoef ;
13091309 minDamages += minDamages * (int )(itemClass)*0 .2f ;
13101310 maxDamages += maxDamages * (int )(itemClass)*0 .2f ;
1311- minDamages=( int ) MIN (1 .0f ,minDamages);
1312- maxDamages=( int ) MIN (1 .0f ,maxDamages);
1311+ minDamages=std::min< int > (1 .0f ,minDamages);
1312+ maxDamages=std::min< int > (1 .0f ,maxDamages);
13131313
13141314 if ( minDamages != maxDamages ) {
13151315 descCon->print (CON_W/4 ,cy++," %d-%d damages/hit" , (int )minDamages,(int )maxDamages);
@@ -1530,8 +1530,8 @@ bool Item::update(float elapsed, TCOD_key_t key, TCOD_mouse_t *mouse) {
15301530 // ##
15311531 // ##
15321532 // .
1533- float fdx=ABS (dx);
1534- float fdy=ABS (dy);
1533+ float fdx=std::abs (dx);
1534+ float fdy=std::abs (dy);
15351535 if ( fdx >= fdy ) dy=-dy;
15361536 if ( fdy >= fdx ) dx=-dx;
15371537 } else if (! xwalk ) {
@@ -1552,8 +1552,8 @@ bool Item::update(float elapsed, TCOD_key_t key, TCOD_mouse_t *mouse) {
15521552 } else {
15531553 ItemFeatureAttack *feat=(ItemFeatureAttack *)getFeature(ItemFeature::ATTACK);
15541554 if ( feat ) {
1555- if (!owner->isPlayer() && ABS (curoldx - (int)gameEngine->player->x) < 2
1556- && ABS (curoldy - (int)gameEngine->player->y) < 2 ) {
1555+ if (!owner->isPlayer() && std::abs (curoldx - (int)gameEngine->player->x) < 2
1556+ && std::abs (curoldy - (int)gameEngine->player->y) < 2 ) {
15571557 // a projectile hits the player
15581558 gameEngine->player->takeDamage(TCODRandom::getInstance()->getFloat(feat->minDamagesCoef,feat->maxDamagesCoef));
15591559 x=oldx;y=oldy;
0 commit comments