Skip to content

Commit

Permalink
Array indexing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IS4Code committed Jul 5, 2018
1 parent 30057a1 commit 3b39e1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData)
}
);

logprintf(" PawnPlus v0.7 loaded");
logprintf(" PawnPlus v0.7.1 loaded");
logprintf(" Created by IllidanS4");
return true;
}
Expand All @@ -50,7 +50,7 @@ PLUGIN_EXPORT void PLUGIN_CALL Unload()
{
Hooks::Unregister();

logprintf(" PawnPlus v0.7 unloaded");
logprintf(" PawnPlus v0.7.1 unloaded");
}

PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx)
Expand Down
9 changes: 5 additions & 4 deletions plugins/src/objects/dyn_object.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _SCL_SECURE_NO_WARNINGS
#include "dyn_object.h"
#include "dyn_op.h"
#include "../fixes/linux.h"
Expand Down Expand Up @@ -318,7 +319,7 @@ cell dyn_object::get_array(const cell *indices, cell num_indices, cell *arr, cel
block = array_data + 1;
cell data_begin = this->begin() - block, data_end = this->end() - block;
begin = 0;
end = rank > 2 ? block[0] / sizeof(cell) : data_end;
end = rank >= 2 ? block[0] / sizeof(cell) : data_end;
for(cell i = 0; i < num_indices; i++)
{
cell index = indices[i];
Expand Down Expand Up @@ -369,7 +370,7 @@ cell *dyn_object::get_cell_addr(const cell *indices, cell num_indices)

cell *block = array_data + 1;
cell data_begin = begin() - block, data_end = end() - block;
cell begin = 0, end = rank > 2 ? block[0] / sizeof(cell) : data_end;
cell begin = 0, end = rank >= 2 ? block[0] / sizeof(cell) : data_end;
for(cell i = 0; i < num_indices; i++)
{
cell index = indices[i];
Expand Down Expand Up @@ -409,7 +410,7 @@ const cell *dyn_object::get_cell_addr(const cell *indices, cell num_indices) con

const cell *block = array_data + 1;
cell data_begin = begin() - block, data_end = end() - block;
cell begin = 0, end = rank > 2 ? block[0] / sizeof(cell) : data_end;
cell begin = 0, end = rank >= 2 ? block[0] / sizeof(cell) : data_end;
for(cell i = 0; i < num_indices; i++)
{
cell index = indices[i];
Expand Down Expand Up @@ -532,7 +533,7 @@ cell dyn_object::get_size(const cell *indices, cell num_indices) const

const cell *block = array_data + 1;
cell data_begin = begin() - block, data_end = end() - block;
cell begin = 0, end = block[0] / sizeof(cell);
cell begin = 0, end = rank >= 2 ? block[0] / sizeof(cell) : data_end;
bool cells = false;
for(cell i = 0; i < num_indices; i++)
{
Expand Down

0 comments on commit 3b39e1e

Please sign in to comment.