Fix getting arguments

This commit is contained in:
Federico Cecchetto 2021-05-29 22:32:31 +02:00
parent 90151c0b38
commit dc2d8135cd
3 changed files with 4 additions and 3 deletions

View File

@ -53,7 +53,7 @@ namespace gsc
for (auto i = 0; i < game::scr_VmPub->outparamcount; i++)
{
const auto value = game::scr_VmPub->top[i];
const auto value = game::scr_VmPub->top[-i];
args.push_back(value);
}

View File

@ -145,7 +145,7 @@ namespace scripting
push_value(*i);
}
game::AddReftoObject(id);
game::AddRefToObject(id);
const auto local_id = game::AllocThread(id);
const auto result = game::VM_Execute(local_id, pos, arguments.size());

View File

@ -7,10 +7,11 @@ namespace game
// Functions
WEAK symbol<void(int type, VariableUnion u)> AddRefToValue{0x5656E0};
WEAK symbol<void(unsigned int id)> AddReftoObject{0x5655F0};
WEAK symbol<void(unsigned int id)> AddRefToObject{0x5655F0};
WEAK symbol<unsigned int(unsigned int id)> AllocThread{0x565580};
WEAK symbol<unsigned int()> AllocObject{0x565530};
WEAK symbol<void(int type, VariableUnion u)> RemoveRefToValue{0x565730};
WEAK symbol<void(unsigned int id)> RemoveRefToObject{0x5681E0};
WEAK symbol<void(unsigned int weapon, bool isAlternate, char* output, unsigned int maxStringLen)> BG_GetWeaponNameComplete{0x42F760};