838 |
|
|
839 |
VMFnResult* InstrumentScriptVMFunction_change_attack::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_attack::exec(VMFnArgs* args) { |
840 |
int attack = args->arg(1)->asInt()->evalInt(); |
int attack = args->arg(1)->asInt()->evalInt(); |
841 |
if (attack > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
842 |
wrnMsg("change_attack(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the attack time) |
843 |
attack = VM_EG_PAR_MAX_VALUE; |
if (attack < 0) { |
|
} else if (attack < 0) { |
|
844 |
wrnMsg("change_attack(): argument 2 may not be negative"); |
wrnMsg("change_attack(): argument 2 may not be negative"); |
845 |
attack = 0; |
attack = 0; |
846 |
} |
} |
924 |
|
|
925 |
VMFnResult* InstrumentScriptVMFunction_change_decay::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_decay::exec(VMFnArgs* args) { |
926 |
int decay = args->arg(1)->asInt()->evalInt(); |
int decay = args->arg(1)->asInt()->evalInt(); |
927 |
if (decay > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
928 |
wrnMsg("change_decay(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the decay time) |
929 |
decay = VM_EG_PAR_MAX_VALUE; |
if (decay < 0) { |
|
} else if (decay < 0) { |
|
930 |
wrnMsg("change_decay(): argument 2 may not be negative"); |
wrnMsg("change_decay(): argument 2 may not be negative"); |
931 |
decay = 0; |
decay = 0; |
932 |
} |
} |
1010 |
|
|
1011 |
VMFnResult* InstrumentScriptVMFunction_change_release::exec(VMFnArgs* args) { |
VMFnResult* InstrumentScriptVMFunction_change_release::exec(VMFnArgs* args) { |
1012 |
int release = args->arg(1)->asInt()->evalInt(); |
int release = args->arg(1)->asInt()->evalInt(); |
1013 |
if (release > VM_EG_PAR_MAX_VALUE) { |
// note: intentionally not checking against a max. value here! |
1014 |
wrnMsg("change_release(): argument 2 may not be larger than 1000000"); |
// (to allow i.e. passing 2000000 for doubling the release time) |
1015 |
release = VM_EG_PAR_MAX_VALUE; |
if (release < 0) { |
|
} else if (release < 0) { |
|
1016 |
wrnMsg("change_release(): argument 2 may not be negative"); |
wrnMsg("change_release(): argument 2 may not be negative"); |
1017 |
release = 0; |
release = 0; |
1018 |
} |
} |