RTS: Trail

This commit is contained in:
Krzosa Karol
2023-04-19 15:01:43 +02:00
parent b7385221ac
commit 2d5c2d89bc
2 changed files with 46 additions and 26 deletions

View File

@@ -22,6 +22,7 @@ MAP_Actor :: struct
state: int
open_paths: Array(MAP_Path)
close_paths: Array(MAP_Path)
tiles_visited: Array(V2I)
history: Array(MAP_Path)
MAP_Path :: struct
@@ -127,6 +128,8 @@ MAP_MoveTowardsTarget :: (s: *MAP_Actor)
*tile &= ~MAP_TILE_ACTOR_IS_STANDING
Assert((*tile & MAP_TILE_ACTOR_IS_STANDING) == 0)
Add(&s.tiles_visited, s.p)
step := s.history.data[s.history.len-2]
s.p = step.p