IFV + Temporal weapon + mobile fire

Bug #896130 reported by Chanterier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Fix Released
Medium
Unassigned

Bug Description

Something I've noticed and investigated to find when this was affected.

Original rulesmd file. Added following tags to make IFV fire on move:

MobileFire=yes
OpportunityFire=yes
PreventAttackMove=no

But blam. It doesn't. I remember it did long time ago, when I first tried making IFV fire on move, but when I enabled it in MO again - I noticed that IFV will only face it's turret to the enemy but won't fire.

First - I checked what's causing it. It was Chrono Legionairre's IFV mode weapon - CRNeutronRifle, which looks like this.

[CRNeutronRifle]
Damage=5
ROF=120
Range=6
Speed=100
Projectile=InvisibleLow
Warhead=ChronoBeam
Report=
IsRadBeam=yes
Report=ChronoLegionAttack

And has a warhead:

[ChronoBeam]
Verses=100%,100%,100%,100%,100%,100%,100%,100%,100%,100%,0%
Temporal=yes

After more tests, it turned out that it's the Temporal=yes tag that prevents the IFV from firing on the move! After removing the tag, it was able to do so again.

In vanilla YR without Ares, Temporal=yes does not affect IFV's fire-on-move. So I checked when this was broken.

IFV is able to fire on move with Ares with 0.1.113.1 but becomes bugged in 0.1.179.1.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Somehow I feel that the more code we add, the crazier unexpected side-effects will be.

Revision history for this message
Renegade (renegade) wrote :

Thanks for reporting, especially in this amount of detail. :)

Revision history for this message
Graion Dilach (graiondilach) wrote :

Disabling 71A87B, TemporalClass_Update_CacheWH, 6 makes this work, however disabling this and keeping the Warpaway hook will break Temporal totally.

Still, the WarpAway deglobalization causes this.

Revision history for this message
WoRmINaToR (worminator) wrote :

I can confirm that I noticed this a long time ago, never figured out that cause though (and therefore didn't think it was an Ares issue)... good to know.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

A change related to this bug has been committed:

https://github.com/Ares-Developers/Ares/commit/b1fdb691f3dfa1a5f9dbc0cba84c906fdc2fc7a6

Potential fix for issue 1517/bug 896130 (Temporal + Fire on the Move) :

Funny westwood/Ares logic interaction was happening previously.
Stock YR code creates a TemporalImUsing only for TechnoClass whose *Primary* is Temporal, not secondary or other. This means you couldn't have temporal secondaries. Ares fixed that by instantiating it for every unit that needs it.
This unfortunately was done without properly investigating the IFV weapon switching code. This code replaces the vehicle's TemporalImUsing with the gunner's when it enters, and hands it back to the gunner when s/he exits the vehicle. After this, the unit's TIU is set to NULL. This means that 1) the unit's original TIU that Ares instantiated is leaked; 2) if the unit did have a Temporal weapon for its unmanned mode, it will crash when trying to fire it.
In addition, this had an unexpected side-effect. UnitClass::GetFireError is called to check if a unit can fire at the moment, and that code says 'you cannot fire, you are moving' if a unit has a TemporalImUsing and is moving. This means that in Ares, an IFV cannot use MobileFire=yes (if it does, it will only be able to fire on the move correctly *after* a temporal-wielding gunner exits it).
This commit should theoretically fix these problems:
- Save the unit's original TIU before a gunner replaces it
- Restore it after a gunner exits
- just for completeness, sweep the saved pointer when running AnnounceInvalidPointer, even though it shouldn't come to this.
- Change to 'you cannot fire, you are moving' to check if the unit is a gunner and currently wielding a temporal weapon OR not a gunner and in possession of a TIU. This condition *should* be correct...

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

I wonder if this fix works for anyone...

Changed in ares:
status: New → Fix Committed
Revision history for this message
Graion Dilach (graiondilach) wrote :

I thought I already told you on IRC on that same day or the following one that the fix worked here.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Why do we tell people to file bugs instead of reporting them on IRC? So that we don't have to keep random IRC convos in our heads and tell all the other developers about a bug J Random User reported...

Same here, if I was on IRC when you reported that, doesn't mean Ren or Alex were, and what should they do if they want to know the status? Also, it's really our standard procedure to ask for multiple confirmations, you know :)

Revision history for this message
Chanterier (speederyr) wrote :

It's fixed.

Revision history for this message
Renegade (renegade) wrote :

Confirmed as fixed by Speeder and mevitar.

Changed in ares:
status: Fix Committed → Fix Released
milestone: none → 0.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.