psu_game: Fix a GID/NPCid mismatch in the npc_invite event.
This commit is contained in:
parent
8de811642c
commit
2ef6a53f58
@ -793,7 +793,6 @@ event({npc_invite, NPCid}) ->
|
|||||||
log("invited npcid ~b", [NPCid]),
|
log("invited npcid ~b", [NPCid]),
|
||||||
TmpNPCUser = psu_npc:user_init(NPCid, ((User#egs_user_model.character)#characters.mainlevel)#level.number),
|
TmpNPCUser = psu_npc:user_init(NPCid, ((User#egs_user_model.character)#characters.mainlevel)#level.number),
|
||||||
%% Create and join party.
|
%% Create and join party.
|
||||||
%% @todo Check if party already exists.
|
|
||||||
case User#egs_user_model.partypid of
|
case User#egs_user_model.partypid of
|
||||||
undefined ->
|
undefined ->
|
||||||
{ok, PartyPid} = psu_party:start_link(GID),
|
{ok, PartyPid} = psu_party:start_link(GID),
|
||||||
@ -807,8 +806,8 @@ event({npc_invite, NPCid}) ->
|
|||||||
egs_user_model:write(User#egs_user_model{partypid=PartyPid}),
|
egs_user_model:write(User#egs_user_model{partypid=PartyPid}),
|
||||||
%% Send stuff.
|
%% Send stuff.
|
||||||
Character = NPCUser#egs_user_model.character,
|
Character = NPCUser#egs_user_model.character,
|
||||||
SentNPCCharacter = Character#characters{gid=NPCid},
|
SentNPCCharacter = Character#characters{gid=NPCid, npcid=NPCid},
|
||||||
SentNPCUser = NPCUser#egs_user_model{id=NPCid, character=SentNPCCharacter},
|
SentNPCUser = NPCUser#egs_user_model{character=SentNPCCharacter},
|
||||||
send_1004(npc_invite, SentNPCUser, PartyPos),
|
send_1004(npc_invite, SentNPCUser, PartyPos),
|
||||||
send_101a(NPCid, PartyPos);
|
send_101a(NPCid, PartyPos);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user