[DiscordArchive] should be only value?
[DiscordArchive] should be only value?
Archived author: jackpoz • Posted: 2023-01-25T18:53:22.504000+00:00
Original source
it's a uint32 array storing "stuff" related to the object
Archived author: CyberMist2 • Posted: 2023-01-25T18:53:24.916000+00:00
Original source
let me try to write what would be the fix..:
```c++
for (uint16 index = 0; index < m_valuesCount; ++index)
{
if (_fieldNotifyFlags & flags[index] ||
((updateType == UPDATETYPE_VALUES ? _changesMask.GetBit(index) : m_uint32Values[index]) && (flags[index] & visibleFlag)))
{
updateMask.SetBit(index);
if (isType(TYPEMASK_UNIT))
fieldBuffer << value;
else
fieldBuffer << m_uint32Values[index];
}
}
```
Archived author: CyberMist2 • Posted: 2023-01-25T18:53:53.668000+00:00
Original source
please slap me if I am not on the right way
Archived author: jackpoz • Posted: 2023-01-25T18:54:14.971000+00:00
Original source
well there is a lot more logic to add to that line
Archived author: jackpoz • Posted: 2023-01-25T18:54:51.540000+00:00
Original source
1) check if current object is unit
2) check if current index is health or max health
3) write to fieldBuffer a different value than m_uint32Values[index]
Archived author: jackpoz • Posted: 2023-01-25T18:55:28.055000+00:00
Original source
when writing m_uint32Values[index] , it means "go to the array m_uint32Values and access the element at index position, with 1st element at index 0"
Archived author: CyberMist2 • Posted: 2023-01-25T18:55:33.745000+00:00
Original source
```c++
for (uint16 index = 0; index < m_valuesCount; ++index)
{
if (_fieldNotifyFlags & flags[index] ||
((updateType == UPDATETYPE_VALUES ? _changesMask.GetBit(index) : m_uint32Values[index]) && (flags[index] & visibleFlag)))
{
updateMask.SetBit(index);
if (isType(TYPEMASK_UNIT))
{
if (index == UNIT_FIELD_HEALTH || index == UNIT_FIELD_MAXHEALTH)
{
uint32 value = m_uint32Values[index];
switch (index)
{
case UNIT_FIELD_HEALTH: value = uint32(ceil((100.0 * value) / m_uint32Values[UNIT_FIELD_MAXHEALTH])); break;
case UNIT_FIELD_MAXHEALTH: value = 100; break;
}
fieldBuffer << value;
}
}
else
fieldBuffer << m_uint32Values[index];
}
}
```
Archived author: jackpoz • Posted: 2023-01-25T18:56:00.912000+00:00
Original source
so when you wrote m_uint32Values[value] with value set at 100 you basically did "go to array m_uint32Values and access the element at 100 hp"
Archived author: jackpoz • Posted: 2023-01-25T18:56:11.853000+00:00
Original source
which doesn't make much sense
Archived author: CyberMist2 • Posted: 2023-01-25T18:56:27.273000+00:00
Original source
In that array I have to find the health index?