diff --git a/src/mapper/map_func.cc b/src/mapper/map_func.cc index 8b032f2..0ba769c 100644 --- a/src/mapper/map_func.cc +++ b/src/mapper/map_func.cc @@ -22,6 +22,26 @@ void copy_proto_lists() // TODO: Incomplete. } +// 0x484294 +void sort_rect(Rect* a, Rect* b) +{ + if (b->right > b->left) { + a->left = b->left; + a->right = b->right; + } else { + a->left = b->right; + a->right = b->left; + } + + if (b->bottom > b->top) { + a->top = b->top; + a->bottom = b->bottom; + } else { + a->top = b->bottom; + a->bottom = b->top; + } +} + // 0x4842D4 void draw_rect(Rect* rect, unsigned char color) { diff --git a/src/mapper/map_func.h b/src/mapper/map_func.h index 3d03b42..843f72a 100644 --- a/src/mapper/map_func.h +++ b/src/mapper/map_func.h @@ -7,6 +7,7 @@ namespace fallout { void setup_map_dirs(); void copy_proto_lists(); +void sort_rect(Rect* a, Rect* b); void draw_rect(Rect* rect); void erase_rect(Rect* rect); int toolbar_proto(int type, int id);