Ticket #44834

Lua: allow create_unit_full() to place a unit in a transport it can't freely load

Open Date: 2022-06-15 05:08 Last Update: 2022-06-23 22:34

Reporter:
Owner:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

There is no problem if a unit can't load its ttttransport in the place it is. I would mark it a bug and target to 3.0 but without #44738 it's too difficult to do.

Ticket History (3/11 Histories)

2022-06-15 05:08 Updated by: ihnatus
  • New Ticket "Lua: allow create_unit_full() to place a unit in a transport it can't freely load" created
2022-06-18 15:18 Updated by: ihnatus
  • File edit-create_unit_full-to-unboardable.patch (File ID: 9532) is attached
2022-06-18 15:18 Updated by: ihnatus
Comment

Patched.

2022-06-18 16:06 Updated by: cazfi
Comment

As 'placed' is only used within assert, I think it will cause "set, but unused variable" -warning on FREECIV_NDEBUG build.

2022-06-18 19:59 Updated by: ihnatus
Comment

Reply To cazfi

As 'placed' is only used within assert, I think it will cause "set, but unused variable" -warning on FREECIV_NDEBUG build.

What you think should I do, use #ifdef FREECIV_NDEBUG preprocessor branching? I likely have used place_unit() that way in some previous patch.

2022-06-18 20:04 Updated by: cazfi
Comment

Reply To ihnatus

Reply To cazfi

As 'placed' is only used within assert, I think it will cause "set, but unused variable" -warning on FREECIV_NDEBUG build.

What you think should I do, use #ifdef FREECIV_NDEBUG preprocessor branching? I likely have used place_unit() that way in some previous patch.

That's what we use in other places. A lot of those went in recently in #43868.

2022-06-20 04:57 Updated by: ihnatus
  • File edit-create_unit_full-to-unboardable.patch (File ID: 9532) is deleted
2022-06-20 04:58 Updated by: ihnatus
Comment

Fixed, also, centralized the conditions a bit.

2022-06-20 05:15 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2022-06-23 22:34 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

Please login to add comment to this ticket » Login