Incidencia #44461

citizen_set segfault with alien/alio

Abrir Fecha: 2022-04-25 07:10 Última actualización: 2022-04-28 08:10

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Hito:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
2

Details

Starting alien ruleset game, accepting the tileset suggestion (don't know if it's relevant that the tileset was not correct one to begin with), and then trying to add an ocean city in editor mode (maybe relevant: in my tests the only ocean tiles revealed by initial vision radius were under FoW) -> client crash.

get_citizen_sprite (t=0x55555d485e50, type=CITIZEN_CONTENT, citizen_index=<optimized out>,

pcity=pcity@entry=0x55555e42ec00) at ../../../src/client/tilespec.c:6516

6516 if (graphic == NULL || graphic->count == 0) {

Ticket History (3/8 Histories)

2022-04-25 07:10 Updated by: cazfi
  • New Ticket "citizen_set segfault with alien/alio" created
2022-04-25 15:59 Updated by: cazfi
Comentario

(At least part of) the problem seems to be in that citizen sets stuff is not initialized as the ruleset loads (number of city styles get set etc), if it had not been available at the time tileset was loaded ( tilespec_reread() was not able to set that stuff up )

2022-04-25 20:24 Updated by: cazfi
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Ninguno to Accepted
2022-04-25 21:23 Updated by: cazfi
  • Resolución Update from Accepted to Ninguno
Comentario

The current patch breaks the opposite, and more common case, that the ruleset is *not* sent after tileset load.

2022-04-25 21:33 Updated by: cazfi
  • Resolución Update from Ninguno to Accepted
Comentario

Reply To cazfi

The current patch breaks the opposite, and more common case, that the ruleset is *not* sent after tileset load.

That was because of tileset_setup_city_tiles() refusing to handle anything but the current last style - when style count has already gone up there was no handling earlier ones.

Attached patch is a quick fix. No refactoring for that design at this point. Should work for both cases now.

2022-04-28 08:10 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar