Fix achat par un joueur
This commit is contained in:
parent
6a85073dbb
commit
d874720973
@ -56,13 +56,17 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static remoteActorCall(options) {
|
static remoteActorCall(data) {
|
||||||
options.userId = options.userId ?? Misc.connectedGMOrUser();
|
if (Misc.isElectedUser()){
|
||||||
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_remote_actor_call", data: options });
|
RdDActor.onRemoteActorCall(data);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_remote_actor_call", data: data });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static onRemoteActorCall(data) {
|
static onRemoteActorCall(data) {
|
||||||
if (game.user.id == data.userId) { // Seul le joueur choisi effectue l'appel
|
if (Misc.isElectedUser()) { // Seul le joueur choisi effectue l'appel
|
||||||
const actor = game.actors.get(data?.actorId);
|
const actor = game.actors.get(data?.actorId);
|
||||||
if (!actor) {
|
if (!actor) {
|
||||||
console.info("RdDActor.onRemoteActorCall: Pas d'Actor disponible ", data);
|
console.info("RdDActor.onRemoteActorCall: Pas d'Actor disponible ", data);
|
||||||
@ -3425,8 +3429,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
if (!Misc.isElectedUser()) {
|
if (!Misc.isElectedUser()) {
|
||||||
RdDActor.remoteActorCall({
|
RdDActor.remoteActorCall({
|
||||||
userId: Misc.connectedGMOrUser(),
|
actorId: vendeurId ?? acheteurId,
|
||||||
actorId: this.vendeur?.id ?? this.acheteur?.id,
|
|
||||||
method: 'achatVente', args: [vendeurId, acheteurId, venteData, chatMessageIdVente]
|
method: 'achatVente', args: [vendeurId, acheteurId, venteData, chatMessageIdVente]
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user