Ticket #48211

give_shared_vision() tripled map_get_own_seen() call

Open Date: 2023-06-10 12:06 Last Update: 2023-10-01 05:49

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

Details

give_shared_vision() has

              V_RADIUS(map_get_own_seen(pplayer, ptile, V_MAIN),
                       map_get_own_seen(pplayer, ptile, V_INVIS),
                       map_get_own_seen(pplayer, ptile, V_SUBSURFACE));
That is, exactly same vision base is calculated three times. We recently fixed similar case in unittools.c, so functions supporting optimization already exist.

Ticket History (3/8 Histories)

2023-06-10 12:06 Updated by: cazfi
  • New Ticket "give_shared_vision() tripled map_get_own_seen() call" created
2023-08-29 19:47 Updated by: cazfi
2023-09-25 06:26 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2023-09-25 07:37 Updated by: cazfi
  • Resolution Update from Accepted to None
Comment

clang:

../../../src/server/maphand.c:1137:19: error: unused function 'map_get_own_seen' [-Werror,-Wunused-function]
static inline int map_get_own_seen(const struct player *pplayer,

2023-09-25 08:01 Updated by: cazfi
  • Resolution Update from None to Accepted
Comment

Reply To cazfi

clang: {{{ ../../../src/server/maphand.c:1137:19: error: unused function 'map_get_own_seen' -Werror,-Wunused-function static inline int map_get_own_seen(const struct player *pplayer, }}}

Fixed in attached version

2023-10-01 05:49 Updated by: cazfi
  • Status Update from Open to Closed
  • 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