feat: Füge Debug-Overlay und Alters-/Geschlechtsanpassungen für 3D-Charaktere hinzu
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
This commit is contained in:
@@ -4601,16 +4601,26 @@ class FalukantService extends BaseService {
|
||||
if (!marriedType) {
|
||||
throw new Error('Relationship type "married" not found');
|
||||
}
|
||||
await Relationship.create({
|
||||
const newRel = await Relationship.create({
|
||||
character1Id: proposal.requesterCharacterId,
|
||||
character2Id: proposal.proposedCharacterId,
|
||||
relationshipTypeId: marriedType.id,
|
||||
});
|
||||
await MarriageProposal.destroy({
|
||||
where: { requesterCharacterId: character.id },
|
||||
})
|
||||
;
|
||||
return { success: true, message: 'Marriage proposal accepted' };
|
||||
|
||||
await MarriageProposal.destroy({ where: { requesterCharacterId: character.id } });
|
||||
|
||||
// Ensure both households are marked as unburdened upon marriage creation
|
||||
try {
|
||||
const otherChar = await FalukantCharacter.findByPk(proposal.proposedCharacterId, { attributes: ['userId'] });
|
||||
const otherFUserId = otherChar ? otherChar.userId : null;
|
||||
const affectedUserIds = [user.id];
|
||||
if (otherFUserId) affectedUserIds.push(otherFUserId);
|
||||
await UserHouse.update({ householdTensionScore: 0, householdTensionReasonsJson: [] }, { where: { userId: affectedUserIds } });
|
||||
} catch (err) {
|
||||
console.error('Failed to reset household tension on marriage:', err);
|
||||
}
|
||||
|
||||
return { success: true, message: 'Marriage proposal accepted', relationshipId: newRel.id };
|
||||
}
|
||||
|
||||
async cancelWooing(hashedUserId) {
|
||||
|
||||
Reference in New Issue
Block a user