add checking in spell actions
This commit is contained in:
parent
f4f7f1154d
commit
7069f30165
1 changed files with 25 additions and 0 deletions
|
@ -183,6 +183,11 @@ local void CclSpellAction(lua_State* l, SpellActionType* spellaction)
|
|||
lua_error(l);
|
||||
}
|
||||
}
|
||||
// Now, checking value.
|
||||
if (spellaction->Data.SpawnMissile.Missile == NULL) {
|
||||
lua_pushstring(l, "Use a missile for spawn-missile (with missile)");
|
||||
lua_error(l);
|
||||
}
|
||||
} else if (!strcmp(value, "area-adjust-vitals")) {
|
||||
spellaction->CastFunction = CastAreaAdjustVitals;
|
||||
for (; j < args; ++j) {
|
||||
|
@ -243,6 +248,11 @@ local void CclSpellAction(lua_State* l, SpellActionType* spellaction)
|
|||
lua_error(l);
|
||||
}
|
||||
}
|
||||
// Now, checking value.
|
||||
if (spellaction->Data.AreaBombardment.Missile == NULL) {
|
||||
lua_pushstring(l, "Use a missile for area-bombardment (with missile)");
|
||||
lua_error(l);
|
||||
}
|
||||
} else if (!strcmp(value, "demolish")) {
|
||||
spellaction->CastFunction = CastDemolish;
|
||||
for (; j < args; ++j) {
|
||||
|
@ -328,6 +338,11 @@ local void CclSpellAction(lua_State* l, SpellActionType* spellaction)
|
|||
lua_error(l);
|
||||
}
|
||||
}
|
||||
// Now, checking value.
|
||||
if (spellaction->Data.Summon.UnitType == NULL) {
|
||||
lua_pushstring(l, "Use a unittype for summon (with unit-type)");
|
||||
lua_error(l);
|
||||
}
|
||||
} else if (!strcmp(value, "spawn-portal")) {
|
||||
spellaction->CastFunction = CastSpawnPortal;
|
||||
for (; j < args; ++j) {
|
||||
|
@ -349,6 +364,11 @@ local void CclSpellAction(lua_State* l, SpellActionType* spellaction)
|
|||
lua_error(l);
|
||||
}
|
||||
}
|
||||
// Now, checking value.
|
||||
if (spellaction->Data.SpawnPortal.PortalType == NULL) {
|
||||
lua_pushstring(l, "Use a unittype for spawn-portal (with portal-type)");
|
||||
lua_error(l);
|
||||
}
|
||||
} else if (!strcmp(value, "polymorph")) {
|
||||
spellaction->CastFunction = CastPolymorph;
|
||||
for (; j < args; ++j) {
|
||||
|
@ -374,6 +394,11 @@ local void CclSpellAction(lua_State* l, SpellActionType* spellaction)
|
|||
lua_error(l);
|
||||
}
|
||||
}
|
||||
// Now, checking value.
|
||||
if (spellaction->Data.Polymorph.NewForm == NULL) {
|
||||
lua_pushstring(l, "Use a unittype for polymorph (with new-form)");
|
||||
lua_error(l);
|
||||
}
|
||||
} else if (!strcmp(value, "adjust-vitals")) {
|
||||
spellaction->CastFunction = CastAdjustVitals;
|
||||
for (; j < args; ++j) {
|
||||
|
|
Loading…
Add table
Reference in a new issue