Ticket #42969

Client: Make trade route drawing robust against unknown partner

Open Date: 2021-10-02 21:26 Last Update: 2021-10-04 23:04

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

Details

Related to #42968

Currently player is expected to always know any trade partners of his/her own cities, but 1) it won't hurt for the client to be robust against the opposite case, and 2) that might not be true sometime in the future.

This ticket is about changing draw_trade_routes_for_city() not to crash when the trade partner from trade_partners_iterate() is NULL.

Ticket History (3/6 Histories)

2021-10-02 21:26 Updated by: cazfi
  • New Ticket "Client: Make trade route drawing robust against unknown partner" created
2021-10-02 21:31 Updated by: cazfi
Comment

Even when #42968 gets fixed for the future servers, this ticket helps clients to work with older servers.

(Edited, 2021-10-02 21:32 Updated by: cazfi)
2021-10-02 21:41 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.0
Comment

S2_6 is not affected, as there the iterator macro used contains NULL check.

2021-10-02 22:18 Updated by: cazfi
Comment

Targeting to beta3, even with less than one week to go:

- Avoids a crash, one that presumably occurs quite regularly in longer games
- Is trivial (unlike the fix to actual #42968)
- Crash is a regression since 2.6 -> to anyone switching branches

2021-10-04 23:04 Updated by: cazfi
  • Status Update from Open to Closed
  • Owner Update from (None) to cazfi
  • Resolution Update from Accepted to Fixed

Edit

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