Ticket #47463

action_is_hostile() rework

Open Date: 2023-02-20 19:51 Last Update: 2023-03-04 21:29

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

Details

action_is_hostile() has several aspects I'd like to improve.

- It lives in unittype.c, even when it's about actions
- It's another massive switch - case, based on actres. Should be turned to a quick array lookup
- Type of the parameter needs to be checked. Both actres pointer and action pointer would likely be better than current action id

Ticket History (3/5 Histories)

2023-02-20 19:51 Updated by: cazfi
  • New Ticket "action_is_hostile() rework" created
2023-02-22 08:46 Updated by: cazfi
Comment

Better to implement on top of #47464 than before it.

2023-03-02 20:29 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2023-03-04 21:29 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login