Write planes fixed on game start to disk properly
When fixing planes stuck in the air, we fixed them only in memory, so when a fixed plane wasn't written to disk for other reasons before the next game start, it had to be fixed again. Change pln_zap_transient_flags() to write them out.
This commit is contained in:
parent
dd0e0423ee
commit
4e9e58bf6a
1 changed files with 6 additions and 1 deletions
|
@ -169,19 +169,24 @@ pln_zap_transient_flags(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct plnstr *pp;
|
struct plnstr *pp;
|
||||||
|
int dirty = 0;
|
||||||
|
|
||||||
/* laziness: assumes plane file is EFF_MEM */
|
/* laziness: assumes plane file is EFF_MEM */
|
||||||
for (i = 0; (pp = getplanep(i)) != NULL; i++) {
|
for (i = 0; (pp = getplanep(i)) != NULL; i++) {
|
||||||
if (pp->pln_flags & PLN_LAUNCHED
|
if (pp->pln_flags & PLN_LAUNCHED
|
||||||
&& (plchr[pp->pln_type].pl_flags & (P_M | P_O)) != P_O) {
|
&& (plchr[pp->pln_type].pl_flags & (P_M | P_O)) != P_O) {
|
||||||
pp->pln_flags &= ~PLN_LAUNCHED;
|
pp->pln_flags &= ~PLN_LAUNCHED;
|
||||||
verify_fail(EF_PLANE, i, NULL, 0, "stuck in the air (patched)");
|
/* FIXME missile should be destroyed instead */
|
||||||
|
dirty = 1;
|
||||||
|
verify_fail(EF_PLANE, i, NULL, 0, "stuck in the air (fixed)");
|
||||||
/*
|
/*
|
||||||
* Can't putplane() here, because pln_prewrite() crashes
|
* Can't putplane() here, because pln_prewrite() crashes
|
||||||
* without a valid player.
|
* without a valid player.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dirty)
|
||||||
|
ef_flush(EF_PLANE); /* pretty wasteful */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue