]> git.pond.sub.org Git - empserver/commit
Don't store RAILWAYS track in sectors
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 15 Apr 2008 05:57:03 +0000 (07:57 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Wed, 7 May 2008 08:33:41 +0000 (10:33 +0200)
commitfa5fa4abcc41ff4b11cce852e3aa30c735e659c8
tree79d360992e5f0cbb288e35e009268bdfdf45912c
parent11100f23e5ba925da2e26c2f91dc3086635ef5a2
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.
Make.mk
include/prototypes.h
include/sect.h
src/lib/commands/sinf.c
src/lib/commands/spy.c
src/lib/common/move.c
src/lib/global/nsc.c
src/lib/subs/satmap.c
src/lib/subs/sect.c
src/lib/update/finish.c