Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2353 closed defect (fixed)

[PATCHES] Multiple Town Bell defects

Reported by: Michael Owned by: Itms
Priority: Should Have Milestone: Alpha 16
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

I got an JS error using the town bell during am MP game. (r14508)

The units went into the buildings but when I ended the alarm, I got this error and some units didn't leave the buildings. Perhaps the units which where not in the civic center did not leave thier shelter. But I'm not sure about that.

ERROR: JavaScript error: simulation/components/AlertRaiser.js line 89 TypeError: cmpUnitAI is null ()@simulation/components/AlertRaiser.js:89 ProcessCommand(4,[object Object])@simulation/helpers/Commands.js:440

I'm not sure, if this is enough information for you to get a clue whats the problem...

Attachments (7)

fix.patch (3.6 KB ) - added by Itms 10 years ago.
work_orders_under_alert.patch (818 bytes ) - added by Itms 10 years ago.
work_orders_under_alert.2.patch (1.5 KB ) - added by Itms 10 years ago.
tooltip.patch (982 bytes ) - added by Itms 10 years ago.
fix.2.patch (3.6 KB ) - added by Itms 10 years ago.
work_orders_under_alert.3.patch (2.2 KB ) - added by Itms 10 years ago.
garrison_fail.patch (631 bytes ) - added by Itms 10 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by Itms, 10 years ago

I think I corrected the problem with my last patch on #2342. I leave this ticket open, please tell me if it's solved once it is committed.

Thanks for your feedback ! :)

comment:2 by mimo, 10 years ago

I've just commited #2342 in r14513, but here are some additionnal comments on the AlertRaiser:

We should take into account the possibility that the GarrisonHolder? is destroyed during the attack (and then its units are ejected before the EndOfAlert?) ? I've added a check to cmpGarrisonHolder in EndOfAlert in your patch, but we should also add a check to cmpUnitAI.IsGarrisoned?(), or/and may-be the AlertRaiser? should listen to messages from GarrisonedUnitsChanged? and if it is from one of its units, move the unit from this.garrisonedUnits <-> this.walkingUnits

In addition, while playing, I had this situation: my CC was nearly destroyed, so the units under alert were ejected, and I asked them to repair the cc and save it. But I think my units lost their previous order due to this repair order. So may-be we should not consider Repair order while under alert (or even no order at all while under alert) as a workOrder in UnitAI::UpdateWorkOrders?

We could add a new fonction AddUnits to the AlertRaiser which would only add an array of units. This would be useful in ProductionQueue instead of calling UpdateUnits while we know exactly which units to add.

in reply to:  2 comment:3 by Michael, 10 years ago

Replying to mimo:

In addition, while playing, I had this situation: my CC was nearly destroyed, so the units under alert were ejected, and I asked them to repair the cc and save it. But I think my units lost their previous order due to this repair order. So may-be we should not consider Repair order while under alert (or even no order at all while under alert) as a workOrder in UnitAI::UpdateWorkOrders?

I had the same problem and would prefer that, too!

comment:4 by Itms, 10 years ago

Keywords: review patch added; town bell removed
Summary: Town bell problem during multiplayer[PATCHES] Multiple Town Bell defects

Ok, I wrote two small patches that correct separately -> the behaviour of units ejected out of destroyed buildings (along with the UpdateUnits function) -> unwanted work orders updates during alert

Additionally, I came across a problem with garrison order : when there is not enough room to garrison units in the first garrisonholder, a unit can try to go somewhere else, but comes back to the filled holder and stops. To reproduce it, playing with the Ptolemies, a house, a CC and four women closer to the house are sufficient.

Last edited 10 years ago by Itms (previous) (diff)

by Itms, 10 years ago

Attachment: fix.patch added

by Itms, 10 years ago

comment:5 by Itms, 10 years ago

Improved IsUnderAlert in UnitAI.

comment:6 by Itms, 10 years ago

And also corrected the tooltip as suggested by mimo.

by Itms, 10 years ago

Attachment: tooltip.patch added

comment:7 by mimo, 10 years ago

Thanks for the patches Itms. I had a look at the two last patches and here are some comments:

tooltip.patch: The alert button is now dupplicated once an alert is raised. I would have put first the if block with hasRaisedAlert, and then an elseif block with canIncreaseLevel

work_orders_under_alert.patch: You've added this.isUnderAlert, but isn't it a redondance with this.alertRaiser ? if we just add this.alertRaiser = undefined is this.ResetAlert, and return (this.alertRaiser !== undefined) in IsUnderAlert, that should work ?

I've not yet looked at your third patch. Concerning the bug you reported, is it fixed by your patch ?

comment:8 by Itms, 10 years ago

I corrected this :)

The bug I reported is independent and not fixed by these patches, I'm currently working on it.

by Itms, 10 years ago

Attachment: fix.2.patch added

comment:9 by Itms, 10 years ago

Okay, I found it, it was only a small mistake with UnitAI states.

by Itms, 10 years ago

Attachment: garrison_fail.patch added

comment:10 by mimo, 10 years ago

In 14683:

keep work orders when in alert, patch by Itms, addresses #2353

comment:11 by mimo, 10 years ago

In 14684:

improve alert tooltip, see #2353

comment:12 by mimo, 10 years ago

In 14685:

fix bug when garrisoning under alert and garrisonHolder is full, patch by Itms, see #2353

comment:13 by mimo, 10 years ago

Resolution: fixed
Status: newclosed

In 14689:

fixes remaining town bell defects, closes #2353, patch by Itms

comment:14 by mimo, 10 years ago

Keywords: review removed

Thanks Itms for the patches.

Note: See TracTickets for help on using tickets.