mirror of https://github.com/OpenTTD/OpenTTD
(svn r18640) -Fix (r18633): don't assert when accessing first invalid item, it's used quite often in the code
-Revert (r18637): it's not needed any morerelease/1.0
parent
9574371e53
commit
ce08aebde7
|
@ -225,7 +225,8 @@ public:
|
||||||
*/
|
*/
|
||||||
FORCEINLINE const T *Get(uint index) const
|
FORCEINLINE const T *Get(uint index) const
|
||||||
{
|
{
|
||||||
assert(index < this->items);
|
/* Allow access to the 'first invalid' item */
|
||||||
|
assert(index <= this->items);
|
||||||
return &this->data[index];
|
return &this->data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +238,8 @@ public:
|
||||||
*/
|
*/
|
||||||
FORCEINLINE T *Get(uint index)
|
FORCEINLINE T *Get(uint index)
|
||||||
{
|
{
|
||||||
assert(index < this->items);
|
/* Allow access to the 'first invalid' item */
|
||||||
|
assert(index <= this->items);
|
||||||
return &this->data[index];
|
return &this->data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -435,9 +435,6 @@ public:
|
||||||
|
|
||||||
void DrawMatrix(const Rect &r) const
|
void DrawMatrix(const Rect &r) const
|
||||||
{
|
{
|
||||||
/* Is there something to do? */
|
|
||||||
if (this->content.Length() == 0) return;
|
|
||||||
|
|
||||||
const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX);
|
const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX);
|
||||||
const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(NCLWW_NAME);
|
const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(NCLWW_NAME);
|
||||||
const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(NCLWW_TYPE);
|
const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(NCLWW_TYPE);
|
||||||
|
|
Loading…
Reference in New Issue