diff options
| author | Jonas Ask | 2010-05-24 21:41:03 +0000 |
|---|---|---|
| committer | Jonas Ask | 2010-05-24 21:41:03 +0000 |
| commit | 39c2b0738da253cd5066417c9f789d8ecfaad113 (patch) | |
| tree | fcfbbd5fc8e982c8d906763be7096455e92b24b9 /Constructions.cpp | |
| parent | 20e5c41cef6b20d70354650a20cf2926fe60ec40 (diff) | |
| download | stonesense-39c2b0738da253cd5066417c9f789d8ecfaad113.tar.gz stonesense-39c2b0738da253cd5066417c9f789d8ecfaad113.tar.bz2 stonesense-39c2b0738da253cd5066417c9f789d8ecfaad113.tar.xz | |
Added handling for invalid construction types.
Support for Arena mode.
Diffstat (limited to 'Constructions.cpp')
| -rw-r--r-- | Constructions.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Constructions.cpp b/Constructions.cpp index c514bfe..ec879b2 100644 --- a/Constructions.cpp +++ b/Constructions.cpp @@ -14,8 +14,11 @@ void changeConstructionMaterials(WorldSegment* segment, vector<t_construction>* construct = &(*allConstructions)[i];
b = segment->getBlock(construct->x, construct->y, construct->z);
if( !b ) continue;
- b->material.type=construct->mat_type;
- b->material.index=construct->mat_idx;
+ //don't assign invalid material indexes
+ if(construct->mat_idx != -1){
+ b->material.type = construct->mat_type;
+ b->material.index = construct->mat_idx;
+ }
b->consForm = construct->form;
}
}
|
