mirror of https://github.com/OpenTTD/OpenTTD
(svn r6153) -Codechange: DeleteSign removes a sign from the pool
-Codechange: DestroySign is called by DeleteSign to remove all things where a sign depends on. Last 2 changes to prepare for new pool system. Not pretty now, will be soon.release/0.5
parent
7e6f1f16c0
commit
f25e5e90d2
8
signs.c
8
signs.c
|
@ -103,7 +103,13 @@ static Sign *AllocateSign(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Place a sign at the given coordinates. Ownership of sign has
|
void DestroySign(Sign *si)
|
||||||
|
{
|
||||||
|
DeleteName(si->str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place a sign at the given coordinates. Ownership of sign has
|
||||||
* no effect whatsoever except for the colour the sign gets for easy recognition,
|
* no effect whatsoever except for the colour the sign gets for easy recognition,
|
||||||
* but everybody is able to rename/remove it.
|
* but everybody is able to rename/remove it.
|
||||||
* @param tile tile to place sign at
|
* @param tile tile to place sign at
|
||||||
|
|
4
signs.h
4
signs.h
|
@ -57,9 +57,11 @@ static inline bool IsValidSignID(uint index)
|
||||||
return index < GetSignPoolSize() && IsValidSign(GetSign(index));
|
return index < GetSignPoolSize() && IsValidSign(GetSign(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DestroySign(Sign *si);
|
||||||
|
|
||||||
static inline void DeleteSign(Sign *si)
|
static inline void DeleteSign(Sign *si)
|
||||||
{
|
{
|
||||||
DeleteName(si->str);
|
DestroySign(si);
|
||||||
si->str = STR_NULL;
|
si->str = STR_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue