Quote Originally Posted by Tamamo View Post
Dude lweapon and eweapons are the same damn thing, only difference is what vector they are stored in. They only require one script. Not two.


Some Clarification on Why They Are Separate
Amongst other reasons for which lweapon script, and eweapon script are separated, here are some others that, because of how ZASM and ZScript work internally, effectively mandate segregation:

1. The tables lweapon and eweapon have some different variables/functions. If there was only one weapon script type, then this->function() or this->var or this->arr[] might cause bugs, crashes, or so forth because there would be no ZASM to run them if assigned to a different type

2. Beyond that, this-> stuff is determined by script type during compilation The parser would have no clue what ZASM instructions to use without segregating the script types so that it pulls functions using the correct refvar IDs. Coimbining them would preclude using the this-> pointer, which would be awful.

Basically, the script type tells the parser what tables to use to match strings in a script to ZASM instructions, or to Opcode constructors. If there was only one weapon script type, we'd need to incent a wholly new parser just to make it work! That's pretty far from 'simplification'.

3. Last, because lweapon and eweapon are segregated internally, calling RunScript(SCRIPT_TYPE, ID, CONST) would present some technical issues if we don't know if the script is functioning for an lweapon, or an eweapon. Segregation eases this, and makes integration into the extant editors simpler.. This notwithstanding, is the most trivial of the reasons that they need to be exclusively typed.