… | |
… | |
2105 | case range_misc: |
2105 | case range_misc: |
2106 | fire_misc_object (op, dir); |
2106 | fire_misc_object (op, dir); |
2107 | return; |
2107 | return; |
2108 | |
2108 | |
2109 | case range_golem: /* Control summoned monsters from scrolls */ |
2109 | case range_golem: /* Control summoned monsters from scrolls */ |
2110 | if (op->contr->ranges[range_golem] == NULL || op->contr->golem_count != op->contr->ranges[range_golem]->count) |
2110 | if (QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED)) |
2111 | { |
2111 | { |
2112 | op->contr->ranges[range_golem] = NULL; |
2112 | op->contr->ranges[range_golem] = 0; |
2113 | op->contr->shoottype = range_none; |
2113 | op->contr->shoottype = range_none; |
2114 | op->contr->golem_count = 0; |
|
|
2115 | } |
2114 | } |
2116 | else |
2115 | else |
2117 | control_golem (op->contr->ranges[range_golem], dir); |
2116 | control_golem (op->contr->ranges[range_golem], dir); |
2118 | return; |
2117 | return; |
2119 | |
2118 | |
… | |
… | |
2565 | /* I've been seeing crashes where the golem has been destroyed, but |
2564 | /* I've been seeing crashes where the golem has been destroyed, but |
2566 | * the player object still points to the defunct golem. The code that |
2565 | * the player object still points to the defunct golem. The code that |
2567 | * destroys the golem looks correct, and it doesn't always happen, so |
2566 | * destroys the golem looks correct, and it doesn't always happen, so |
2568 | * put this in a a workaround to clean up the golem pointer. |
2567 | * put this in a a workaround to clean up the golem pointer. |
2569 | */ |
2568 | */ |
2570 | if (op->contr->ranges[range_golem] && |
|
|
2571 | ((op->contr->golem_count != op->contr->ranges[range_golem]->count) || QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED))) |
2569 | if (op->contr->ranges[range_golem] && QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED)) |
2572 | { |
|
|
2573 | op->contr->ranges[range_golem] = NULL; |
2570 | op->contr->ranges[range_golem] = 0; |
2574 | op->contr->golem_count = 0; |
|
|
2575 | } |
|
|
2576 | |
2571 | |
2577 | /* call this here - we also will call this in do_ericserver, but |
2572 | /* call this here - we also will call this in do_ericserver, but |
2578 | * the players time has been increased when doericserver has been |
2573 | * the players time has been increased when doericserver has been |
2579 | * called, so we recheck it here. |
2574 | * called, so we recheck it here. |
2580 | */ |
2575 | */ |
… | |
… | |
3276 | op->contr->party = NULL; |
3271 | op->contr->party = NULL; |
3277 | if (settings.set_title == TRUE) |
3272 | if (settings.set_title == TRUE) |
3278 | op->contr->own_title[0] = '\0'; |
3273 | op->contr->own_title[0] = '\0'; |
3279 | new_draw_info (NDI_UNIQUE | NDI_ALL, 0, NULL, buf); |
3274 | new_draw_info (NDI_UNIQUE | NDI_ALL, 0, NULL, buf); |
3280 | check_score (op); |
3275 | check_score (op); |
|
|
3276 | |
3281 | if (op->contr->ranges[range_golem] != NULL) |
3277 | if (op->contr->ranges[range_golem]) |
3282 | { |
3278 | { |
3283 | remove_friendly_object (op->contr->ranges[range_golem]); |
3279 | remove_friendly_object (op->contr->ranges[range_golem]); |
3284 | remove_ob (op->contr->ranges[range_golem]); |
3280 | remove_ob (op->contr->ranges[range_golem]); |
3285 | free_object (op->contr->ranges[range_golem]); |
3281 | free_object (op->contr->ranges[range_golem]); |
3286 | op->contr->ranges[range_golem] = NULL; |
3282 | op->contr->ranges[range_golem] = 0; |
3287 | op->contr->golem_count = 0; |
|
|
3288 | } |
3283 | } |
|
|
3284 | |
3289 | loot_object (op); /* Remove some of the items for good */ |
3285 | loot_object (op); /* Remove some of the items for good */ |
3290 | remove_ob (op); |
3286 | remove_ob (op); |
3291 | op->direction = 0; |
3287 | op->direction = 0; |
3292 | |
3288 | |
3293 | if (!QUERY_FLAG (op, FLAG_WAS_WIZ) && op->stats.exp) |
3289 | if (!QUERY_FLAG (op, FLAG_WAS_WIZ) && op->stats.exp) |