Don't store RAILWAYS track in sectors
Storing track in sectors is problematic, because we need to update adjacent sectors when updating a sector in a way that changes its capability to extend railway into its neighbors. This invalidates cached adjacent sectors, and calling code may not be prepared for that. Specifically, bridge building caches the bridge head, and writes it back later, wiping out the track update. Replace struct sctstr member sct_track by new sct_rail_track(). Make selector track virtual. Remove the code to keep sct_track up-to-date: set_railway(), update_railway(). Unfortunately, this causes cyclic dependencies between link libraries: the virtual selector needs to be referenced from src/lib/global/nsc.c, and it needs to reference stuff from src/lib/common/file.c. Hack around it in Make.mk for now.
This commit is contained in:
parent
11100f23e5
commit
fa5fa4abcc
10 changed files with 46 additions and 79 deletions
|
@ -627,7 +627,6 @@ extern void sathead(void);
|
|||
extern int sct_postread(int, void *);
|
||||
extern int sct_prewrite(int, void *);
|
||||
extern void item_prewrite(short *);
|
||||
extern void set_railway(struct sctstr *);
|
||||
extern int issector(char *);
|
||||
/* sectdamage.c */
|
||||
extern int sect_damage(struct sctstr *, int);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue