MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / _nexti

Method _nexti

src/script/api/script_list.cpp:804–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804SQInteger ScriptList::_nexti(HSQUIRRELVM vm)
805{
806 if (sq_gettype(vm, 2) == OT_NULL) {
807 if (this->IsEmpty()) {
808 sq_pushnull(vm);
809 return 1;
810 }
811 sq_pushinteger(vm, this->Begin());
812 return 1;
813 }
814
815 SQInteger idx;
816 sq_getinteger(vm, 2, &idx);
817
818 SQInteger val = this->Next();
819 if (this->IsEnd()) {
820 sq_pushnull(vm);
821 return 1;
822 }
823
824 sq_pushinteger(vm, val);
825 return 1;
826}
827
828SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
829{

Callers

nothing calls this directly

Calls 8

IsEmptyMethod · 0.95
BeginMethod · 0.95
NextMethod · 0.95
IsEndMethod · 0.95
sq_gettypeFunction · 0.85
sq_pushnullFunction · 0.85
sq_pushintegerFunction · 0.85
sq_getintegerFunction · 0.85

Tested by

no test coverage detected