Skip to content

Commit c7cd9ac

Browse files
authored
revert on 'script_use_spell_on_creature'
This is a spell, also remove the error log to stop it from filling against creatures that are immunes (All spell kind should be supported by now).
1 parent 102d035 commit c7cd9ac

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/magic.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,19 +2253,19 @@ TbResult script_use_power(PlayerNumber plyr_idx, PowerKind power_kind, char free
22532253
}
22542254

22552255
/**
2256-
* Cast a power on a creature which meets given criteria.
2256+
* Cast a spell on a creature which meets given criteria.
22572257
* @param plyr_idx The player whose creature will be affected.
22582258
* @param crmodel Model of the creature to find.
22592259
* @param criteria Criteria, from CreatureSelectCriteria enumeration.
2260-
* @param fmcl_bytes encoded bytes: f=cast for free flag,m=power kind,c=caster player index,l=power level.
2261-
* @return TbResult whether the power was successfully cast
2260+
* @param fmcl_bytes encoded bytes: f=cast for free flag,m=spell kind,c=caster player index,l=spell level.
2261+
* @return TbResult whether the spell was successfully cast
22622262
*/
22632263
TbResult script_use_spell_on_creature(PlayerNumber plyr_idx, ThingModel crmodel, long criteria, long fmcl_bytes)
22642264
{
22652265
struct Thing *thing = script_get_creature_by_criteria(plyr_idx, crmodel, criteria);
22662266
if (thing_is_invalid(thing))
22672267
{
2268-
SYNCDBG(5, "No matching player %d creature of model %d (%s) found to use power on.", (int)plyr_idx, (int)crmodel, creature_code_name(crmodel));
2268+
SYNCDBG(5, "No matching player %d creature of model %d (%s) found to use spell on.", (int)plyr_idx, (int)crmodel, creature_code_name(crmodel));
22692269
return Lb_FAIL;
22702270
}
22712271
SpellKind spkind = (fmcl_bytes >> 8) & 255;
@@ -2274,7 +2274,7 @@ TbResult script_use_spell_on_creature(PlayerNumber plyr_idx, ThingModel crmodel,
22742274
{ // Immunity is handled in 'apply_spell_effect_to_thing', but this command plays sounds, so check for it.
22752275
if (thing_is_picked_up(thing))
22762276
{
2277-
SYNCDBG(5, "Found creature to cast the power on but it is being held.");
2277+
SYNCDBG(5, "Found creature to cast the spell on but it is being held.");
22782278
return Lb_FAIL;
22792279
}
22802280
CrtrExpLevel spell_level = fmcl_bytes & 255;
@@ -2293,7 +2293,6 @@ TbResult script_use_spell_on_creature(PlayerNumber plyr_idx, ThingModel crmodel,
22932293
}
22942294
else
22952295
{
2296-
SCRPTERRLOG("power not supported for this command: %d", (int)spkind);
22972296
return Lb_FAIL;
22982297
}
22992298
}

0 commit comments

Comments
 (0)