rewrite game_level::player_position to be more efficient.
This commit is contained in:
parent
4a2d8770d9
commit
63eaea3536
1 changed files with 2 additions and 3 deletions
|
@ -126,9 +126,8 @@ namespace GameDB {
|
|||
|
||||
components::Position& player_position() {
|
||||
dbc::check(initialized, "Forgot to call GameDB::init()");
|
||||
auto world = current_world();
|
||||
auto& player = world->get_the<components::Player>();
|
||||
return world->get<components::Position>(player.entity);
|
||||
auto level = current_level();
|
||||
return level.world->get<components::Position>(level.player);
|
||||
}
|
||||
|
||||
DinkyECS::Entity the_player() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue