psu_game: Don't stop the instance if it doesn't exist.

This commit is contained in:
Loïc Hoguin 2010-08-22 23:03:19 +02:00
parent c1de8254c4
commit 30b3155146

View File

@ -660,7 +660,9 @@ event(mission_abort) ->
send_1006(11), send_1006(11),
{ok, User} = egs_user_model:read(get(gid)), {ok, User} = egs_user_model:read(get(gid)),
%% delete the mission %% delete the mission
psu_instance:stop(User#egs_user_model.instancepid), if User#egs_user_model.instancepid =:= undefined -> ignore;
true -> psu_instance:stop(User#egs_user_model.instancepid)
end,
%% full hp %% full hp
Character = User#egs_user_model.character, Character = User#egs_user_model.character,
MaxHP = Character#characters.maxhp, MaxHP = Character#characters.maxhp,