this->_TextParamError(fmt::format("{}: Parameter {} substring consumes {}, but expected {} to be consumed",name,cur_idx,count-1,cur_param.consumes-1));
}
param_count+=count;
break;
}
default:
if(cur_idx+cur_param.consumes>this->paramc){
this->_TextParamError(fmt::format("{}: Not enough parameters",name));
if(cur_idx>=this->paramc)throwScript_FatalError(fmt::format("{}: Not enough parameters",name));
if(prev_string!=-1){
/* The previous substring added more parameters than expected, means we will consume them but can't properly validate them. */
for(inti=0;i<cur_param.consumes;i++){
if(prev_idx<prev_count){
ScriptLog::Warning(fmt::format("{}: Parameter {} uses parameter {} from substring {} and cannot be validated",name,param_count+i,prev_idx++,prev_string));
}else{
/* No more extra parameters, assume SQInteger are expected. */
if(cur_idx>=this->paramc)throwScript_FatalError(fmt::format("{}: Not enough parameters",name));
if(!std::holds_alternative<SQInteger>(this->param[cur_idx]))throwScript_FatalError(fmt::format("{}: Parameter {} expects an integer",name,param_count+i));
if(!std::holds_alternative<std::string>(this->param[cur_idx]))throwScript_FatalError(fmt::format("{}: Parameter {} expects a raw string",name,param_count));
this->_TextParamError(fmt::format("{}: Parameter {} substring consumes {}, but expected {} to be consumed",name,cur_idx,count-1,cur_param.consumes-1));
if(++count!=cur_param.consumes){
ScriptLog::Error(fmt::format("{}: Parameter {} substring consumes {}, but expected {} to be consumed",name,param_count,count-1,cur_param.consumes-1));
/* The previous substring added more parameters than expected, means we will consume them but can't properly validate them. */
for(inti=0;i<cur_param.consumes;i++){
if(prev_idx<prev_count){
ScriptLog::Warning(fmt::format("{}: Parameter {} uses parameter {} from substring {} and cannot be validated",name,param_count+i,prev_idx++,prev_string));
}else{
/* No more extra parameters, assume SQInteger are expected. */
if(cur_idx>=this->paramc)throwScript_FatalError(fmt::format("{}: Not enough parameters",name));
if(cur_idx+cur_param.consumes>this->paramc)throwScript_FatalError(fmt::format("{}: Not enough parameters",name));
for(inti=0;i<cur_param.consumes;i++){
if(!std::holds_alternative<SQInteger>(this->param[cur_idx]))throwScript_FatalError(fmt::format("{}: Parameter {} expects an integer",name,param_count+i));
if(!std::holds_alternative<std::string>(this->param[cur_idx]))throwScript_FatalError(fmt::format("{}: Parameter {} expects a raw string",name,param_count));