Refactor: use enum instead of magic numbers (#176)
This commit is contained in:
parent
21aec548af
commit
b60fe43b06
|
@ -1396,7 +1396,7 @@ int actionUseSkill(Object* a1, Object* a2, int skill)
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
case SKILL_SNEAK:
|
case SKILL_SNEAK:
|
||||||
dudeToggleState(0);
|
dudeToggleState(DUDE_STATE_SNEAKING);
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
debugPrint("\nskill_use: invalid skill used.");
|
debugPrint("\nskill_use: invalid skill used.");
|
||||||
|
|
|
@ -690,7 +690,7 @@ int animationRegisterRunToObject(Object* owner, Object* destination, int actionP
|
||||||
animationDescription->destination = destination;
|
animationDescription->destination = destination;
|
||||||
|
|
||||||
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|
||||||
|| (owner == gDude && dudeHasState(0) && !perkGetRank(gDude, PERK_SILENT_RUNNING))
|
|| (owner == gDude && dudeHasState(DUDE_STATE_SNEAKING) && !perkGetRank(gDude, PERK_SILENT_RUNNING))
|
||||||
|| !artExists(buildFid(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1))) {
|
|| !artExists(buildFid(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1))) {
|
||||||
animationDescription->anim = ANIM_WALK;
|
animationDescription->anim = ANIM_WALK;
|
||||||
} else {
|
} else {
|
||||||
|
@ -786,7 +786,7 @@ int animationRegisterRunToTile(Object* owner, int tile, int elevation, int actio
|
||||||
animationDescription->elevation = elevation;
|
animationDescription->elevation = elevation;
|
||||||
|
|
||||||
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|
||||||
|| (owner == gDude && dudeHasState(0) && !perkGetRank(gDude, PERK_SILENT_RUNNING))
|
|| (owner == gDude && dudeHasState(DUDE_STATE_SNEAKING) && !perkGetRank(gDude, PERK_SILENT_RUNNING))
|
||||||
|| !artExists(buildFid(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1))) {
|
|| !artExists(buildFid(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1))) {
|
||||||
animationDescription->anim = ANIM_WALK;
|
animationDescription->anim = ANIM_WALK;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3043,7 +3043,7 @@ int _dude_run(int a1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!perkGetRank(gDude, PERK_SILENT_RUNNING)) {
|
if (!perkGetRank(gDude, PERK_SILENT_RUNNING)) {
|
||||||
dudeDisableState(0);
|
dudeDisableState(DUDE_STATE_SNEAKING);
|
||||||
}
|
}
|
||||||
|
|
||||||
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
reg_anim_begin(ANIMATION_REQUEST_RESERVED);
|
||||||
|
|
|
@ -1186,8 +1186,8 @@ int characterEditorShow(bool isCreationMode)
|
||||||
characterEditorRestorePlayer();
|
characterEditorRestorePlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dudeHasState(0x03)) {
|
if (dudeHasState(DUDE_STATE_LEVEL_UP_AVAILABLE)) {
|
||||||
dudeDisableState(0x03);
|
dudeDisableState(DUDE_STATE_LEVEL_UP_AVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
interfaceRenderHitPoints(false);
|
interfaceRenderHitPoints(false);
|
||||||
|
|
Loading…
Reference in New Issue