11.02.2016, 13:56
@mk124, the gamemode is already being compiled with -d3 option (I even tried to compile with pawn, the result was the same - no any references to lines or components where error is being occured).
Also, I did some other tests and changed the code of java function to this:
In a result, only one object should be spawned. But now, the server didn't crash and started to output next (after I called shoebill_SpawnRandomItems() in pawn):
I have experienced this error once, fixed by increasing #define dynamic value, but this time it didn't help.
Anyway, it's strange, I guess you shouldn't bother with this, until the error appears in other places I'll try to find how to avoid calling that java function from pawn.
Also, another question: how to send an array from pawn to java function except for String type?
For now, I send it as a String and add char's to the string as integers like this:
Is there another way to do this?
Also, I did some other tests and changed the code of java function to this:
PHP код:
public void spawnItemsFromPoints(Collection<ItemSpawnPoint> points) {
Vector3D defaultOffset = new Vector3D();
// Limit of amount of objects to be spawned
int limit = 1;
for (ItemSpawnPoint spawnPoint : points) {
if(limit != -1) {
if(limit-- <= 0) {
break;
}
}
Vector3D offset = defaultOffset;
// Create random item
ItemGroup itemModel = this.getRandomItemModel(spawnPoint);
Item item = generateItemWithRandomCondition(itemModel);
// Object offsets setup
Vector3D rotation = spawnPoint.rotation;
if(rotation.getX() == 0f && rotation.getY() == 0f) {
offset = itemModel.getModelPosOffset();
rotation = itemModel.getModelRotationOffset().clone();
rotation.setZ(spawnPoint.rotation.getZ());
}
// Spawn the item
GroundItem.create(item, spawnPoint.location, offset.getX(), offset.getY(), offset.getZ(), rotation.getX(), rotation.getY(), rotation.getZ(), false);
}
//Player.get().forEach(player -> Functions.update(player, StreamerType.OBJECT));
}
Код:
[debug] AMX backtrace: [debug] Run time error 7: "Stack underflow" [debug] Stack pointer (STK) is 0x24A8D7C, stack top (STP) is 0x24A8D78 [debug] AMX backtrace: [debug] Run time error 7: "Stack underflow" [debug] Stack pointer (STK) is 0x24A8D7C, stack top (STP) is 0x24A8D78 [debug] AMX backtrace: [debug] Run time error 7: "Stack underflow" [debug] Stack pointer (STK) is 0x24A8D7C, stack top (STP) is 0x24A8D78 [debug] AMX backtrace: [debug] Run time error 7: "Stack underflow" [debug] Stack pointer (STK) is 0x24A8D7C, stack top (STP) is 0x24A8D78 [debug] AMX backtrace: [debug] Run time error 7: "Stack underflow" [debug] Stack pointer (STK) is 0x24A8D7C, stack top (STP) is 0x24A8D78 [debug] AMX backtrace: [debug] Run time error 7: "Stack underflow"
Anyway, it's strange, I guess you shouldn't bother with this, until the error appears in other places I'll try to find how to avoid calling that java function from pawn.
Also, another question: how to send an array from pawn to java function except for String type?
For now, I send it as a String and add char's to the string as integers like this:
PHP код:
String array = objects[0];
array += (char) 12;