Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] should be only value?

[DiscordArchive] should be only value?

[DiscordArchive] should be only value?

Pages (10): Previous 1 2 3 4 5 10 Next  
rektbyfaith
Administrator
0
01-25-2023, 06:53 PM
#21
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
rektbyfaith
01-25-2023, 06:53 PM #21

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

rektbyfaith
Administrator
0
01-25-2023, 06:53 PM
#22
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];
}
}
```
rektbyfaith
01-25-2023, 06:53 PM #22

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];
}
}
```

rektbyfaith
Administrator
0
01-25-2023, 06:53 PM
#23
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
rektbyfaith
01-25-2023, 06:53 PM #23

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

rektbyfaith
Administrator
0
01-25-2023, 06:54 PM
#24
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
rektbyfaith
01-25-2023, 06:54 PM #24

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

rektbyfaith
Administrator
0
01-25-2023, 06:54 PM
#25
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]
rektbyfaith
01-25-2023, 06:54 PM #25

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]

rektbyfaith
Administrator
0
01-25-2023, 06:55 PM
#26
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"
rektbyfaith
01-25-2023, 06:55 PM #26

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"

rektbyfaith
Administrator
0
01-25-2023, 06:55 PM
#27
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];
}
}
```
rektbyfaith
01-25-2023, 06:55 PM #27

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];
}
}
```

rektbyfaith
Administrator
0
01-25-2023, 06:56 PM
#28
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"
rektbyfaith
01-25-2023, 06:56 PM #28

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"

rektbyfaith
Administrator
0
01-25-2023, 06:56 PM
#29
Archived author: jackpoz • Posted: 2023-01-25T18:56:11.853000+00:00
Original source

which doesn't make much sense
rektbyfaith
01-25-2023, 06:56 PM #29

Archived author: jackpoz • Posted: 2023-01-25T18:56:11.853000+00:00
Original source

which doesn't make much sense

rektbyfaith
Administrator
0
01-25-2023, 06:56 PM
#30
Archived author: CyberMist2 • Posted: 2023-01-25T18:56:27.273000+00:00
Original source

In that array I have to find the health index?
rektbyfaith
01-25-2023, 06:56 PM #30

Archived author: CyberMist2 • Posted: 2023-01-25T18:56:27.273000+00:00
Original source

In that array I have to find the health index?

Pages (10): Previous 1 2 3 4 5 10 Next  
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)