summaryrefslogtreecommitdiff
path: root/src/map/magic-interpreter-base.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-12-23 14:23:32 -0800
committerBen Longbons <b.r.longbons@gmail.com>2012-12-24 10:52:13 -0800
commita1a02150d710df2838060445b9ad447689538985 (patch)
tree8ae2d08ebbd04df92a2e07f738a614d4f22157f1 /src/map/magic-interpreter-base.cpp
parent7afacd63fe36eb56b52490ecf22daeaa95657942 (diff)
downloadtmwa-a1a02150d710df2838060445b9ad447689538985.tar.gz
tmwa-a1a02150d710df2838060445b9ad447689538985.tar.bz2
tmwa-a1a02150d710df2838060445b9ad447689538985.tar.xz
tmwa-a1a02150d710df2838060445b9ad447689538985.zip
Enumify some more things ... maybe even everything
Diffstat (limited to 'src/map/magic-interpreter-base.cpp')
-rw-r--r--src/map/magic-interpreter-base.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp
index 229dadb..ec59d38 100644
--- a/src/map/magic-interpreter-base.cpp
+++ b/src/map/magic-interpreter-base.cpp
@@ -4,7 +4,7 @@
#include "magic-interpreter-aux.hpp"
static
-void set_int_p(val_t *v, int i, int t)
+void set_int_p(val_t *v, int i, TY t)
{
v->ty = t;
v->v.v_int = i;
@@ -208,7 +208,7 @@ env_t *spell_create_env(magic_conf_t *conf, spell_t *spell,
default:
free(param);
fprintf(stderr, "Unexpected spellarg type %d\n",
- spell->spellarg_ty);
+ uint8_t(spell->spellarg_ty));
}
set_env_entity(VAR_CASTER, &caster->bl);
@@ -328,7 +328,7 @@ int spellguard_can_satisfy(spellguard_check_t *check, character_t *caster,
unsigned int casttime = (unsigned int) check->casttime;
if (VAR(VAR_MIN_CASTTIME).ty == TY_INT)
- casttime = MAX(casttime, VAR(VAR_MIN_CASTTIME).v.v_int);
+ casttime = max(casttime, VAR(VAR_MIN_CASTTIME).v.v_int);
caster->cast_tick = tick + casttime; /* Make sure not to cast too frequently */
@@ -401,7 +401,8 @@ effect_set_t *spellguard_check_sub(spellguard_check_t *check,
return NULL;
default:
- fprintf(stderr, "Unexpected spellguard type %d\n", guard->ty);
+ fprintf(stderr, "Unexpected spellguard type %d\n",
+ uint8_t(guard->ty));
return NULL;
}
@@ -459,7 +460,7 @@ void spell_set_location(invocation_t *invocation, entity_t *entity)
void spell_update_location(invocation_t *invocation)
{
- if (invocation->spell->flags & SPELL_FLAG_LOCAL)
+ if (bool(invocation->spell->flags & SPELL_FLAG_LOCAL))
return;
else
{
@@ -517,7 +518,7 @@ invocation_t *spell_clone_effect(invocation_t *base)
retval->subject = 0;
retval->status_change_refs_nr = 0;
retval->status_change_refs = NULL;
- retval->flags = 0;
+ retval->flags = INVOCATION_FLAG::ZERO;
retval->bl.id = 0;
retval->bl.prev = NULL;
@@ -533,9 +534,9 @@ void spell_bind(character_t *subject, invocation_t *invocation)
{
/* Only bind nonlocal spells */
- if (!(invocation->spell->flags & SPELL_FLAG_LOCAL))
+ if (!bool(invocation->spell->flags & SPELL_FLAG_LOCAL))
{
- if (invocation->flags & INVOCATION_FLAG_BOUND
+ if (bool(invocation->flags & INVOCATION_FLAG_BOUND)
|| invocation->subject || invocation->next_invocation)
{
int *i = NULL;