Ticket #46005

Qt: mr_menu::find_last_unit_pos() dead assignment of 'punit'

Open Date: 2022-10-29 12:18 Last Update: 2024-02-09 15:41

Reporter:
Owner:
(None)
Type:
Status:
Open
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
None

Details

mr_menu::find_last_unit_pos() assigns local 'punit' as the last line before returning.

Ticket History (3/9 Histories)

2022-10-29 12:18 Updated by: cazfi
  • New Ticket "Qt: mr_menu::find_last_unit_pos() dead assignment of 'punit'" created
2022-11-05 11:56 Updated by: cazfi
Comment

I really don't understand the overall logic of slot_execute_orders() -> find_last_unit_pos() call, the only place where latter is called. Former has iterated units_list.unit_list to the point where the unit in question is, and then it asks latter to do same iteration to the same spot, and to access data there.

2022-11-05 12:00 Updated by: cazfi
Comment

Well, find_last_unit_pos() might find unit's *transport* before unit itself, but 1) why would that be necessary as the unit itself in the same tile (within the transport) anyway, 2) inconsistency in that if the transport is in the list *after* the unit (not sure if that's possible), it's not used.

2022-12-05 00:19 Updated by: cazfi
2023-01-30 13:00 Updated by: cazfi
2023-04-04 03:10 Updated by: cazfi
2023-06-27 07:29 Updated by: cazfi
2023-11-10 15:05 Updated by: cazfi
2024-02-09 15:41 Updated by: cazfi

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login