MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ListResize

Function ListResize

engine/Evaluator/express.cpp:642–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640}
641
642static GameValue ListResize(const GameState* state, GameValuePar oper1, GameValuePar oper2)
643{
644 if (oper1.GetReadOnly())
645 {
646 state->SetError(EvalBadVar);
647 return NOTHING;
648 }
649 const GameArrayType& array = oper1;
650 float index = oper2;
651 int sel = toInt(index);
652 GameArrayType& arrayNC = const_cast<GameArrayType&>(array);
653 arrayNC.Resize(sel);
654 return NOTHING;
655}
656
657static bool CheckArrayInValue(const GameArrayType& array1, const GameValue& value)
658{

Callers

nothing calls this directly

Calls 4

toIntFunction · 0.50
GetReadOnlyMethod · 0.45
SetErrorMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected