Skip to content
Snippets Groups Projects
Commit 4f4bc29c authored by Ronnie Friman's avatar Ronnie Friman
Browse files

updated flagbox owner logic

parent d884e55f
No related branches found
No related tags found
3 merge requests!59Development to master,!36Development,!33Small fixes
......@@ -100,7 +100,7 @@ export class FlagboxEventDTO {
@IsNumber()
@Min(0)
@Max(3)
owner: number; // owner = 0, => first entry in faction db, owner = 1, => second entry etc
owner: number; // owner = 0, => no owner, owner = 1, => first entry in faction db
@IsNumber()
@Min(0)
@Max(3)
......
......@@ -210,9 +210,10 @@ export class GameService {
const eventUpdate = await this.objectivePoint_HistoryRepository.create({
oP_HistoryTimestamp: data.oP_HistoryTimestamp,
action: data.action,
capture: factionRef[data.capture],
owner: factionRef[data.owner],
objective_point: objectiveRef,
// -1 as 0 means null
capture: data.capture !== 0 ? factionRef[data.capture - 1] : null,
owner: data.owner !== 0 ? factionRef[data.owner - 1] : null,
objective_point: objectiveRef.objectivePointId,
});
await this.objectivePoint_HistoryRepository.insert(eventUpdate);
// send flagbox event to flagbox subscribers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment