Skip to content

entityManager.entities doesn't hold the entities from the current frame, but the frame before. #50

@Cazka

Description

@Cazka

This is an issue, which I discovered, when I had a new idea for a script, which displays the discord pfp of your friends on their tank body.

Here is a demo that shows the issue

diepAPI.mp4

First i thought, that the diepAPI.apis.scaling.toCanvasPos() is not perfect #49

But after some testing i found out that entityManager.entities doesn't store the information of the entities from the current frame.

game.on('frame', () => {
this.#entities = this.#entitiesUpdated;
this.#entitiesUpdated = [];
});

The entities from the current frame are stored in #entities and are later in the next frame copied over to #entitiesUpdated.

get entities(): Entity[] {
return this.#entities;
}

The solution is to remove #entitiesUpdated and only store entity information in #entities. There also needs to be found a solution for the game.on('frame') listener to be called after all other listeners have been triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions