forked from mirror/OpenTTD
(svn r26238) -Codechange: Use StringParameters::GetDataLeft to check for left space in the param array.
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
offset(0),
|
||||
num_param(size)
|
||||
{
|
||||
assert(size <= parent.num_param - parent.offset);
|
||||
assert(size <= parent.GetDataLeft());
|
||||
if (parent.type == NULL) {
|
||||
this->type = NULL;
|
||||
} else {
|
||||
@@ -89,6 +89,12 @@ public:
|
||||
return &this->data[this->offset];
|
||||
}
|
||||
|
||||
/** Return the amount of elements which can still be read. */
|
||||
uint GetDataLeft() const
|
||||
{
|
||||
return this->num_param - this->offset;
|
||||
}
|
||||
|
||||
/** Get a pointer to a specific element in the data array. */
|
||||
uint64 *GetPointerToOffset(uint offset) const
|
||||
{
|
||||
|
Reference in New Issue
Block a user