[DiscordArchive] what are the arrays used for?
[DiscordArchive] what are the arrays used for?
Archived author: Anchy • Posted: 2024-04-30T06:28:35.074000+00:00
Original source
what are the arrays used for?
Archived author: Frost® • Posted: 2024-04-30T06:37:43.281000+00:00
Original source
<@251803844307189761> are u happy with these https://github.com/azerothcore/azerothco...pull/18805 as the applyspellfix version you determine it as a hackfix
[Embed: fix(Scripts/IcecrownCitadel): Gunship Cannons generates heat on Cas...]
Makes the Cannons on Gunship Blizzlike. They generate power (heat) on cast and not on Hit.
Still uses spellscript effect but on cast instead.
Changes Proposed:
This PR proposes changes to:
Core...
https://github.com/azerothcore/azerothco...pull/18805
Archived author: sudlud • Posted: 2024-04-30T07:16:48.260000+00:00
Original source
Schedule for a firework show, about 500-2000 entries per location
Archived author: sudlud • Posted: 2024-04-30T07:17:09.692000+00:00
Original source
(Timestamp, gameobject id, spawn position)
Archived author: sudlud • Posted: 2024-04-30T07:17:59.928000+00:00
Original source
I mean I can also make a separate script for each location but that would also be a lot of copy and paste code
Archived author: Anchy • Posted: 2024-04-30T07:23:15.936000+00:00
Original source
by location do you mean area? or map?
Archived author: Anchy • Posted: 2024-04-30T07:35:00.360000+00:00
Original source
i would probably store this data in a table and load it as required
Archived author: walkline • Posted: 2024-04-30T08:08:01.724000+00:00
Original source
Something like this?
```
void initArrayA(uint32** &array, size_t &size) {
uint32_t staticArray[][3] = {
{1, 2, 3},
{4, 5, 6},
};
size = sizeof(staticArray) / sizeof(staticArray[0]);
array = new uint32*[size];
for (size_t i = 0; i < size; ++i) {
array[i] = new uint32_t[3];
for (size_t j = 0; j < 3; ++j) {
array[i][j] = staticArray[i][j];
}
}
}
void initArrayB(uint32** &array, size_t &size)
{
//...
}
void main()
{
uint32** array;
size_t arraySize;
if (myConditionTrue)
initArrayA(array, arraySize);
else
initArrayB(array, arraySize);
}
```
Archived author: walkline • Posted: 2024-04-30T08:10:26.856000+00:00
Original source
But you also need to have a code to deallocate that array.
Archived author: sudlud • Posted: 2024-04-30T09:02:17.778000+00:00
Original source
thanks! that is a good approach, but maybe I did not make my use case clear enough.