| 751 | } |
| 752 | |
| 753 | void CScriptArray::InsertAt(std::uint32_t index, void* value) |
| 754 | { |
| 755 | if (index > buffer->numElements) { |
| 756 | // If this is called from a script we raise a script exception |
| 757 | asIScriptContext* ctx = asGetActiveContext(); |
| 758 | if (ctx) { |
| 759 | ctx->SetException("Index out of bounds"); |
| 760 | } |
| 761 | return; |
| 762 | } |
| 763 | |
| 764 | // Make room for the new element |
| 765 | Resize(1, index); |
| 766 | |
| 767 | // Set the value of the new element |
| 768 | SetValue(index, value); |
| 769 | } |
| 770 | |
| 771 | void CScriptArray::InsertAt(std::uint32_t index, const CScriptArray& arr) |
| 772 | { |