From 1a651243bb2c8e18baa9aac30ac52a62185074e7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 30 Mar 2014 23:14:12 -0700 Subject: Be stricter about most arrays --- src/map/mob.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/map/mob.cpp') diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 61dcfb6..c4a4304 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -1305,7 +1305,7 @@ int mob_can_reach(dumb_ptr md, dumb_ptr bl, int range) int mob_target(dumb_ptr md, dumb_ptr bl, int dist) { dumb_ptr sd; - eptr sc_data; + eptr sc_data; MobMode mode; nullpo_ret(md); @@ -3560,15 +3560,15 @@ bool extract(XString str, MobSkillCondition *msc) { const struct { - char str[32]; + ZString str; MobSkillCondition id; } cond1[] = { - {"always", MobSkillCondition::MSC_ALWAYS}, - {"myhpltmaxrate", MobSkillCondition::MSC_MYHPLTMAXRATE}, - {"notintown", MobSkillCondition::MSC_NOTINTOWN}, - {"slavelt", MobSkillCondition::MSC_SLAVELT}, - {"slavele", MobSkillCondition::MSC_SLAVELE}, + {ZString("always"), MobSkillCondition::MSC_ALWAYS}, + {ZString("myhpltmaxrate"), MobSkillCondition::MSC_MYHPLTMAXRATE}, + {ZString("notintown"), MobSkillCondition::MSC_NOTINTOWN}, + {ZString("slavelt"), MobSkillCondition::MSC_SLAVELT}, + {ZString("slavele"), MobSkillCondition::MSC_SLAVELE}, }; for (auto& pair : cond1) if (str == pair.str) @@ -3584,14 +3584,14 @@ bool extract(XString str, MobSkillState *mss) { const struct { - char str[32]; + ZString str; MobSkillState id; } state[] = { - {"any", MobSkillState::ANY}, - {"idle", MobSkillState::MSS_IDLE}, - {"walk", MobSkillState::MSS_WALK}, - {"attack", MobSkillState::MSS_ATTACK}, + {ZString("any"), MobSkillState::ANY}, + {ZString("idle"), MobSkillState::MSS_IDLE}, + {ZString("walk"), MobSkillState::MSS_WALK}, + {ZString("attack"), MobSkillState::MSS_ATTACK}, }; for (auto& pair : state) if (str == pair.str) @@ -3607,12 +3607,12 @@ bool extract(XString str, MobSkillTarget *mst) { const struct { - char str[32]; + ZString str; MobSkillTarget id; } target[] = { - {"target", MobSkillTarget::MST_TARGET}, - {"self", MobSkillTarget::MST_SELF}, + {ZString("target"), MobSkillTarget::MST_TARGET}, + {ZString("self"), MobSkillTarget::MST_SELF}, }; for (auto& pair : target) if (str == pair.str) -- cgit v1.2.3-60-g2f50