Fix crystal ball use after being destroyed

Crystal ball can be destroyed when used, so pass the object parameter
back as null in that case.
This commit is contained in:
Pasi Kallinen
2015-11-01 18:49:38 +02:00
parent 07e2d6175f
commit 9181f06dab
4 changed files with 8 additions and 7 deletions

View File

@@ -1401,13 +1401,13 @@ doinvoke()
STATIC_OVL int
arti_invoke(obj)
register struct obj *obj;
struct obj *obj;
{
register const struct artifact *oart = get_artifact(obj);
if (!oart || !oart->inv_prop) {
if (obj->otyp == CRYSTAL_BALL)
use_crystal_ball(obj);
use_crystal_ball(&obj);
else
pline1(nothing_happens);
return 1;