… | |
… | |
1830 | case range_misc: |
1830 | case range_misc: |
1831 | fire_misc_object (op, dir); |
1831 | fire_misc_object (op, dir); |
1832 | return; |
1832 | return; |
1833 | |
1833 | |
1834 | case range_golem: /* Control summoned monsters from scrolls */ |
1834 | case range_golem: /* Control summoned monsters from scrolls */ |
1835 | if (QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED)) |
|
|
1836 | { |
|
|
1837 | op->contr->ranges[range_golem] = 0; |
|
|
1838 | op->contr->shoottype = range_none; |
|
|
1839 | } |
|
|
1840 | else |
|
|
1841 | control_golem (op->contr->ranges[range_golem], dir); |
1835 | control_golem (op->contr->ranges[range_golem], dir); |
1842 | return; |
1836 | return; |
1843 | |
1837 | |
1844 | case range_skill: |
1838 | case range_skill: |
1845 | if (!op->chosen_skill) |
1839 | if (!op->chosen_skill) |
1846 | { |
1840 | { |
1847 | if (op->type == PLAYER) |
1841 | if (op->type == PLAYER) |
1848 | new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use."); |
1842 | new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use."); |
|
|
1843 | |
1849 | return; |
1844 | return; |
1850 | } |
1845 | } |
1851 | |
1846 | |
1852 | do_skill (op, op, op->chosen_skill, dir, NULL); |
1847 | do_skill (op, op, op->chosen_skill, dir, NULL); |
1853 | return; |
1848 | return; |
… | |
… | |
2261 | op->speed_left--; |
2256 | op->speed_left--; |
2262 | return 0; |
2257 | return 0; |
2263 | } |
2258 | } |
2264 | } |
2259 | } |
2265 | |
2260 | |
2266 | /* I've been seeing crashes where the golem has been destroyed, but |
|
|
2267 | * the player object still points to the defunct golem. The code that |
|
|
2268 | * destroys the golem looks correct, and it doesn't always happen, so |
|
|
2269 | * put this in a a workaround to clean up the golem pointer. |
|
|
2270 | */ |
|
|
2271 | if (op->contr->ranges[range_golem] && QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED)) |
|
|
2272 | op->contr->ranges[range_golem] = 0; |
|
|
2273 | |
|
|
2274 | /* call this here - we also will call this in do_ericserver, but |
2261 | /* call this here - we also will call this in do_ericserver, but |
2275 | * the players time has been increased when doericserver has been |
2262 | * the players time has been increased when doericserver has been |
2276 | * called, so we recheck it here. |
2263 | * called, so we recheck it here. |
2277 | */ |
2264 | */ |
2278 | if (op->contr->ns->handle_command ()) |
2265 | if (op->contr->ns->handle_command ()) |
… | |
… | |
2466 | gen_grace = op->stats.maxgrace; |
2453 | gen_grace = op->stats.maxgrace; |
2467 | rate_grace -= rate_grace / 2 * op->contr->gen_grace; |
2454 | rate_grace -= rate_grace / 2 * op->contr->gen_grace; |
2468 | } |
2455 | } |
2469 | |
2456 | |
2470 | /* Regenerate Spell Points */ |
2457 | /* Regenerate Spell Points */ |
2471 | if (op->contr->ranges[range_golem] == NULL && --op->last_sp < 0) |
2458 | if (!op->contr->ranges[range_golem] && --op->last_sp < 0) |
2472 | { |
2459 | { |
2473 | gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10 ? 10 : op->contr->gen_sp_armour); |
2460 | gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10 ? 10 : op->contr->gen_sp_armour); |
2474 | if (op->stats.sp < op->stats.maxsp) |
2461 | if (op->stats.sp < op->stats.maxsp) |
2475 | { |
2462 | { |
2476 | op->stats.sp++; |
2463 | op->stats.sp++; |