catch invalid id on restore
Another EDITLEVEL bump.
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||||
* and save files.
|
* and save files.
|
||||||
*/
|
*/
|
||||||
#define EDITLEVEL 99
|
#define EDITLEVEL 100
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Development status possibilities.
|
* Development status possibilities.
|
||||||
|
|||||||
@@ -473,6 +473,14 @@ relink_light_sources(boolean ghostly)
|
|||||||
for (ls = gl.light_base; ls; ls = ls->next) {
|
for (ls = gl.light_base; ls; ls = ls->next) {
|
||||||
if (ls->flags & LSF_NEEDS_FIXUP) {
|
if (ls->flags & LSF_NEEDS_FIXUP) {
|
||||||
if (ls->type == LS_OBJECT || ls->type == LS_MONSTER) {
|
if (ls->type == LS_OBJECT || ls->type == LS_MONSTER) {
|
||||||
|
if (!ls->id.a_uint) {
|
||||||
|
/* it was possible to get stuck in this loop on bad
|
||||||
|
* savefile data load and repeatedly prompt the player
|
||||||
|
* for a key press after displaying an impossible message.
|
||||||
|
* Consider this bad data from a savefile and panic() */
|
||||||
|
panic("relink_light_sources: id = 0, type = %d",
|
||||||
|
(int) ls->type);
|
||||||
|
}
|
||||||
if (ghostly) {
|
if (ghostly) {
|
||||||
if (!lookup_id_mapping(ls->id.a_uint, &nid))
|
if (!lookup_id_mapping(ls->id.a_uint, &nid))
|
||||||
impossible("relink_light_sources: no id mapping");
|
impossible("relink_light_sources: no id mapping");
|
||||||
|
|||||||
Reference in New Issue
Block a user