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 6 10 Next  
rektbyfaith
Administrator
0
01-25-2023, 06:57 PM
#31
Archived author: CyberMist2 • Posted: 2023-01-25T18:57:00.222000+00:00
Original source

or is the code from above correct at least?
rektbyfaith
01-25-2023, 06:57 PM #31

Archived author: CyberMist2 • Posted: 2023-01-25T18:57:00.222000+00:00
Original source

or is the code from above correct at least?

rektbyfaith
Administrator
0
01-25-2023, 06:57 PM
#32
Archived author: jackpoz • Posted: 2023-01-25T18:57:02.300000+00:00
Original source

the last code you wrote is an improvement, but you are focusing too much on health fields
rektbyfaith
01-25-2023, 06:57 PM #32

Archived author: jackpoz • Posted: 2023-01-25T18:57:02.300000+00:00
Original source

the last code you wrote is an improvement, but you are focusing too much on health fields

rektbyfaith
Administrator
0
01-25-2023, 06:57 PM
#33
Archived author: jackpoz • Posted: 2023-01-25T18:57:17.272000+00:00
Original source

if (index == UNIT_FIELD_HEALTH || index == UNIT_FIELD_MAXHEALTH)
...
fieldBuffer << value;
rektbyfaith
01-25-2023, 06:57 PM #33

Archived author: jackpoz • Posted: 2023-01-25T18:57:17.272000+00:00
Original source

if (index == UNIT_FIELD_HEALTH || index == UNIT_FIELD_MAXHEALTH)
...
fieldBuffer << value;

rektbyfaith
Administrator
0
01-25-2023, 06:57 PM
#34
Archived author: jackpoz • Posted: 2023-01-25T18:57:47.500000+00:00
Original source

what happens if index is not any health field ? well, your code never calls fieldBuffer << m_uint32Values[index] or fieldBuffer << value in that case
rektbyfaith
01-25-2023, 06:57 PM #34

Archived author: jackpoz • Posted: 2023-01-25T18:57:47.500000+00:00
Original source

what happens if index is not any health field ? well, your code never calls fieldBuffer << m_uint32Values[index] or fieldBuffer << value in that case

rektbyfaith
Administrator
0
01-25-2023, 06:58 PM
#35
Archived author: CyberMist2 • Posted: 2023-01-25T18:58:06.123000+00:00
Original source

let me redo
rektbyfaith
01-25-2023, 06:58 PM #35

Archived author: CyberMist2 • Posted: 2023-01-25T18:58:06.123000+00:00
Original source

let me redo

rektbyfaith
Administrator
0
01-25-2023, 06:58 PM
#36
Archived author: jackpoz • Posted: 2023-01-25T18:58:17.525000+00:00
Original source

other than that it's probably the most correct code you wrote
rektbyfaith
01-25-2023, 06:58 PM #36

Archived author: jackpoz • Posted: 2023-01-25T18:58:17.525000+00:00
Original source

other than that it's probably the most correct code you wrote

rektbyfaith
Administrator
0
01-25-2023, 06:58 PM
#37
Archived author: CyberMist2 • Posted: 2023-01-25T18:58:28.732000+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;
}
fieldBuffer << m_uint32Values[index];
}
else
fieldBuffer << m_uint32Values[index];
}
}
```
rektbyfaith
01-25-2023, 06:58 PM #37

Archived author: CyberMist2 • Posted: 2023-01-25T18:58:28.732000+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;
}
fieldBuffer << m_uint32Values[index];
}
else
fieldBuffer << m_uint32Values[index];
}
}
```

rektbyfaith
Administrator
0
01-25-2023, 06:58 PM
#38
Archived author: jackpoz • Posted: 2023-01-25T18:58:39.166000+00:00
Original source

also, really important, when writing code assume that the code is always wrong
rektbyfaith
01-25-2023, 06:58 PM #38

Archived author: jackpoz • Posted: 2023-01-25T18:58:39.166000+00:00
Original source

also, really important, when writing code assume that the code is always wrong

rektbyfaith
Administrator
0
01-25-2023, 06:59 PM
#39
Archived author: jackpoz • Posted: 2023-01-25T18:59:06.494000+00:00
Original source

you need to debug it, setting breakpoints, use "step into" and "step over" and "step out" in your debugging IDE (VS is just the best)
rektbyfaith
01-25-2023, 06:59 PM #39

Archived author: jackpoz • Posted: 2023-01-25T18:59:06.494000+00:00
Original source

you need to debug it, setting breakpoints, use "step into" and "step over" and "step out" in your debugging IDE (VS is just the best)

rektbyfaith
Administrator
0
01-25-2023, 06:59 PM
#40
Archived author: CyberMist2 • Posted: 2023-01-25T18:59:13.983000+00:00
Original source

hmm
rektbyfaith
01-25-2023, 06:59 PM #40

Archived author: CyberMist2 • Posted: 2023-01-25T18:59:13.983000+00:00
Original source

hmm

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