Instead of "unit->carrier.inHangarCount < 5" it should be "(unit->carrier.inHangarCount + unit->carrier.outHangarCount) < 5 The queue being stuck is perfectly logical without that, even if it's less obvious for a reaver than for a carrier.
@Neiv That would require some reverse engineering, right? I'm not really familiar with this.
Well, that one's really simple, just add a functions like this to somewhere they would fit (Look at the various hook/inject files for example or just place them in one of them)
Code
u32 __stdcall isUnselectable(int unit_id) { using namespace UnitId; switch (unit_id) { case nuclear_missile: case scarab: case Spell_DarkSwarm: case Spell_DisruptionWeb: case Special_UpperLevelDoor: case Special_RightUpperLevelDoor: case Special_PitDoor: case Special_RightPitDoor: return 1; default: return 0; } }
u32 __declspec(naked) isUnselectableWrapper() { __asm { push ecx push edx movzx eax, ax push eax call isUnselectable pop edx pop ecx ret } }
And add a hooking call somewhere there as well, so the new code will be run.
Code
jmpPatch(isUnselectableWrapper, 0x0046ED80);
Post has been edited 3 time(s), last time on Jan 30 2016, 6:04 pm by Neiv.
Neiv, it crashes the game when I select any unit (instantly or after a few seconds). Are you sure it's for 1.16.1? I decided to sacrifice disruption web and give it collision, because that's probably the only way to make forcefields fully functional. This isn't that bad, because spells like scanner sweep or disruption web can be easily recreated using scbw::CreateUnit(). There are two minor issues when it goes to forcefields. Despite their elevation settings in units.dat they are always above other ground units and this looks weird when for example an archon stands near it. The other one is a little delay between you click and order execution. Maybe has something to do with orderTimer.
A few cool things going on here. All units entering Guardian Shield get an overlay, units hit by psistorm get the energy sparks overlay (need to do 3 variants of sparks overlay and randomize it to make it look cooler). Added a little block of code that pushes away units when a forcefield is placed (you can see a zergling get pushed back at about 0:18).
Oops, my bad. I didn't check if it worked with optimizations enabled and wasn't too familiar with the way GPTP generally does hooks. I edited the code with a version that should work.
Disruption webs have their elevation hardcoded to 11. The code that does that is located at 004F6AF0 but you can also just manually set sprite->elevation if that's easier.