OpenAWE-Project / OpenAWE

A reimplementation of Remedy Entertainments Alan Wake Engine, in later iterations known as the Northlight Engine
GNU General Public License v3.0
159 stars 13 forks source link

Treat number of arguments as arguments byte length for function calls #36

Closed maaxxaam closed 1 year ago

maaxxaam commented 1 year ago

While working on a PR for #13 I've noticed that some scripting functions are called with additional zero parameters not implied by message_defines. My currrent theory is that function calls store argument byte length inside their first parameter instead of a plain number of arguments, which leads to excessive array allocation in the current version of code. Here is a small patch to change this behaviour. It doesn't seem to break existing scripting functions since there aren't any implemented ones that have entities passed to them as an argument.

Nostritius commented 1 year ago

Merged, Thanks :)