diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index a90cb3566..540b61a36 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -1264,7 +1264,8 @@ DEFINE_ACTION_FUNCTION(FStringStruct, LastIndexOf) { PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_STRING(substr); - ACTION_RETURN_INT(self->LastIndexOf(substr)); + PARAM_INT_DEF(endIndex); + ACTION_RETURN_INT(self->LastIndexOf(substr, endIndex)); } DEFINE_ACTION_FUNCTION(FStringStruct, ToUpper) diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index a6866f0ff..9cba0cb09 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -688,7 +688,7 @@ struct StringStruct native native int CharCodeAt(int pos) const; native String Filter(); native int IndexOf(String substr, int startIndex = 0) const; - native int LastIndexOf(String substr) const; + native int LastIndexOf(String substr, int endIndex = 2147483647) const; native void ToUpper(); native void ToLower(); native int ToInt(int base = 0) const;