Why are there so few "return" functions with SA:MP?
#7

@ CaveDweller: perhaps that's not what actually happens, even if simplified. I would assume that one line of GetPlayerHealth does not actually trigger a packet exchange between the server and the client, but returns the known health value which is updated when the client's health changes. But alright, enough of that...

The reason might very well be that it is indeed faster. When coding C++, it is wise to pass larger elements, classes, etc. by reference to functions so it won't have to be copied onto the stack.

My tests in PAWN from perhaps a year ago have shown that this:
Code:
cache_get_rowcount(rows);
is faster than:
Code:
rows = cache_get_rowcount();
(with the C++ code changed accordingly)

Perhaps this?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)