MCHSL / extools

Various extensions for the BYOND game engine.
MIT License
29 stars 41 forks source link

Allows calls to objects' procs to call ancestor versions of the proc instead when needed #22

Closed Altoids1 closed 4 years ago

Altoids1 commented 4 years ago

Overview

At the moment, calling something like "/datum/disease_ability/symptom/powerful/heal/starlight/temperature_expose" seems to only try to call that very specific variety of that proc, and will not attempt to call parents if that class does not have this proc overwritten/amended for it.

This fixes that.

Coder Warning

In order to do this I added procs_by_inherit, which takes in a string like the above and outputs the "true" string name of the proc to be called. This hashtable is generated dynamically at runtime when procs cannot be found as-written.

Altoids1 commented 4 years ago

Travis you can lick my big ol' bum

ghost commented 4 years ago
/home/travis/build/MCHSL/extools/byond-extools/src/optimizer/optimizer.cpp: In function ‘void optimize_inline(Core::Proc, Disassembly&)’:

/home/travis/build/MCHSL/extools/byond-extools/src/optimizer/optimizer.cpp:121:38: error: cannot bind non-const lvalue reference of type ‘Core::Proc&’ to an rvalue of type ‘Core::Proc’
    Core::Proc& donor = Core::get_proc(instr.bytes()[2]);
                        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

/home/travis/build/MCHSL/extools/byond-extools/src/optimizer/optimizer.cpp:127:49: error: cannot bind non-const lvalue reference of type ‘Disassembly&’ to an rvalue of type ‘Disassembly’
    inline_into(recipient_code, donor.disassemble(), i, recipient.get_local_varcount());
                                ~~~~~~~~~~~~~~~~~^~

GCC isn't as lenient as MSVC is.

Altoids1 commented 4 years ago

Mac did it, not my fault >:(

MCHSL commented 4 years ago

unnecessary since were using the proper byond function now