Update with more pre-generated levels
Also clean up test code to not output unless erroring
This commit is contained in:
parent
dbfd932a64
commit
526451ad02
4 changed files with 59 additions and 19 deletions
|
@ -4,11 +4,16 @@
|
|||
#include <map> // for std::map
|
||||
|
||||
namespace
|
||||
{
|
||||
{
|
||||
// Helper function for generating unique unit ids during static init
|
||||
unit_id_t get_unique_unit_id()
|
||||
unit_id_t get_unique_unit_id(unit_id_t* set = nullptr)
|
||||
{
|
||||
static unit_id_t p = 0;
|
||||
|
||||
// If we have a set value, then set our int
|
||||
if( set )
|
||||
p = *set;
|
||||
|
||||
return p++;
|
||||
}
|
||||
|
||||
|
@ -30,6 +35,13 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
// force a reset of the unit ID value
|
||||
void forceResetUnitId()
|
||||
{
|
||||
unit_id_t i = 0;
|
||||
get_unique_unit_id(&i);
|
||||
}
|
||||
|
||||
// Get a unit from a visual
|
||||
CUnit CUnit::GetUnitFromVis( unitVis_c vis )
|
||||
{
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
#define UNIT_FORMATTER "UNIT:%u tm:%u vs:%c dr:%c ps:[%u,%u]"
|
||||
|
||||
// force a reset of the unit ID value
|
||||
void forceResetUnitId();
|
||||
|
||||
// Base unit type
|
||||
class CUnit
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue