Skip to content

Commit

Permalink
Merge pull request #163 from adadgio/godo43-fixes-from-adadgio
Browse files Browse the repository at this point in the history
Produce error if GaeaRenderer doesn't have a generator assigned
  • Loading branch information
BenjaTK authored Aug 27, 2024
2 parents 425c012 + edb5701 commit aa61fbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/gaea/renderers/2D/tilemap_gaea_renderer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ enum NodeType {

func _ready() -> void:
super()

# generators are always required here, this warning serves purpose for both tilemap types
if !generator:
push_error("TilemapGaeaRenderer needs a GaeaGenerator node assigned in its exports.")
return

match node_type:
NodeType.TILEMAP:
if not is_instance_valid(tile_map):
Expand Down
5 changes: 5 additions & 0 deletions addons/gaea/renderers/3D/gridmap_gaea_renderer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ extends GaeaRenderer3D

func _ready() -> void:
super()

if !generator:
push_error("GridmapGaeaRenderer needs a GaeaGenerator node assigned in its exports.")
return

if grid_map.cell_size * grid_map.scale != generator.tile_size:
push_warning("GridMap's cell size doesn't match with generator's tile size, can cause generation issues.
The generator's tile size has been set to the GridMap's cell size.")
Expand Down

0 comments on commit aa61fbf

Please sign in to comment.