Updated class commands and class editor. Fixed a few compiler warnings.
This commit is contained in:
@ -238,7 +238,7 @@ VolClassEditSetAttribute(dataIndex, const String:attribName[], const String:attr
|
||||
}
|
||||
}
|
||||
|
||||
/* Player behaviour */
|
||||
/* Player behavior */
|
||||
else if (StrEqual(attribName, "immunity_mode", false))
|
||||
{
|
||||
if (VolClassEditSetImmunityMode(dataIndex, attribValue))
|
||||
@ -253,6 +253,13 @@ VolClassEditSetAttribute(dataIndex, const String:attribName[], const String:attr
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (StrEqual(attribName, "immunity_cooldown", false))
|
||||
{
|
||||
if (VolClassEditSetImmunityCooldown(dataIndex, attribValue))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (StrEqual(attribName, "no_fall_damage", false))
|
||||
{
|
||||
if (VolClassEditSetNoFallDamage(dataIndex, attribValue))
|
||||
@ -395,14 +402,18 @@ VolClassEditDumpData(dataIndex, String:buffer[], maxlen)
|
||||
Format(linebuffer, sizeof(linebuffer), CLASSEDIT_DUMP_FORMAT, "Napalm time:", valuebuffer);
|
||||
cellswritten += StrCat(buffer, maxlen, linebuffer);
|
||||
|
||||
VolClassEditIntToString(dataIndex, ClassEdit_ImmunityMode, valuebuffer, sizeof(valuebuffer));
|
||||
ImmunityModeToString(VolClassEditData[dataIndex][ClassEdit_ImmunityMode], valuebuffer, sizeof(valuebuffer));
|
||||
Format(linebuffer, sizeof(linebuffer), CLASSEDIT_DUMP_FORMAT, "Immunity mode:", valuebuffer);
|
||||
cellswritten += StrCat(buffer, maxlen, linebuffer);
|
||||
|
||||
VolClassEditFloatToString(dataIndex, ClassEdit_ImmunityAmount, valuebuffer, sizeof(valuebuffer));
|
||||
VolClassEditIntToString(dataIndex, ClassEdit_ImmunityAmount, valuebuffer, sizeof(valuebuffer));
|
||||
Format(linebuffer, sizeof(linebuffer), CLASSEDIT_DUMP_FORMAT, "Immunity amount:", valuebuffer);
|
||||
cellswritten += StrCat(buffer, maxlen, linebuffer);
|
||||
|
||||
VolClassEditIntToString(dataIndex, ClassEdit_ImmunityCooldown, valuebuffer, sizeof(valuebuffer));
|
||||
Format(linebuffer, sizeof(linebuffer), CLASSEDIT_DUMP_FORMAT, "Immunity cooldown:", valuebuffer);
|
||||
cellswritten += StrCat(buffer, maxlen, linebuffer);
|
||||
|
||||
VolClassEditIntToString(dataIndex, ClassEdit_NoFallDamage, valuebuffer, sizeof(valuebuffer));
|
||||
Format(linebuffer, sizeof(linebuffer), CLASSEDIT_DUMP_FORMAT, "No fall damage:", valuebuffer);
|
||||
cellswritten += StrCat(buffer, maxlen, linebuffer);
|
||||
@ -922,7 +933,8 @@ bool:VolClassEditSetImmunityMode(dataIndex, const String:value[])
|
||||
return false;
|
||||
}
|
||||
|
||||
VolClassEditData[dataIndex][VolClassEdit_ClassData][ClassEdit_ImmunityMode] = StringToInt(value);
|
||||
new ImmunityMode:mode = ImmunityStringToMode(value);
|
||||
VolClassEditData[dataIndex][VolClassEdit_ClassData][ClassEdit_ImmunityMode] = mode;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -943,7 +955,28 @@ bool:VolClassEditSetImmunityAmount(dataIndex, const String:value[])
|
||||
return false;
|
||||
}
|
||||
|
||||
VolClassEditData[dataIndex][VolClassEdit_ClassData][ClassEdit_ImmunityAmount] = StringToFloat(value);
|
||||
VolClassEditData[dataIndex][VolClassEdit_ClassData][ClassEdit_ImmunityAmount] = StringToInt(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the immunity cooldown attribute.
|
||||
*
|
||||
* Note: The value is not validated!
|
||||
*
|
||||
* @param dataIndex Local data index.
|
||||
* @param value String value to set (converted to proper type by this
|
||||
* function).
|
||||
* @return True if set, false if empty.
|
||||
*/
|
||||
bool:VolClassEditSetImmunityCooldown(dataIndex, const String:value[])
|
||||
{
|
||||
if (strlen(value) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VolClassEditData[dataIndex][VolClassEdit_ClassData][ClassEdit_ImmunityCooldown] = StringToInt(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1193,19 +1226,26 @@ VolClassEditUpdateAttributes(client, const attributes[])
|
||||
}
|
||||
|
||||
// Immunity mode.
|
||||
if (attributes[ClassEdit_ImmunityMode] > -1)
|
||||
if (attributes[ClassEdit_ImmunityMode] != Immunity_Invalid)
|
||||
{
|
||||
ClassPlayerCache[client][Class_ImmunityMode] = attributes[ClassEdit_ImmunityMode];
|
||||
numChanges++;
|
||||
}
|
||||
|
||||
// Immunity amount.
|
||||
if (attributes[ClassEdit_ImmunityAmount] > -1.0)
|
||||
if (attributes[ClassEdit_ImmunityAmount] > -1)
|
||||
{
|
||||
ClassPlayerCache[client][Class_ImmunityAmount] = attributes[ClassEdit_ImmunityAmount];
|
||||
numChanges++;
|
||||
}
|
||||
|
||||
// Immunity cooldown.
|
||||
if (attributes[ClassEdit_ImmunityCooldown] > -1)
|
||||
{
|
||||
ClassPlayerCache[client][Class_ImmunityCooldown] = attributes[ClassEdit_ImmunityCooldown];
|
||||
numChanges++;
|
||||
}
|
||||
|
||||
// No fall damage.
|
||||
if (attributes[ClassEdit_NoFallDamage] > -1)
|
||||
{
|
||||
@ -1331,7 +1371,7 @@ VolClassEditRestoreAttributes(client, classindex, const attributes[])
|
||||
}
|
||||
|
||||
// Immunity mode.
|
||||
if (attributes[ClassEdit_ImmunityMode] > -1)
|
||||
if (attributes[ClassEdit_ImmunityMode] != Immunity_Invalid)
|
||||
{
|
||||
ClassPlayerCache[client][Class_ImmunityMode] = ClassGetImmunityMode(classindex, ZR_CLASS_CACHE_MODIFIED);
|
||||
numChanges++;
|
||||
|
Reference in New Issue
Block a user