Skip to content

Commit 323ef13

Browse files
committed
Rename all instances of 'EntityMap' to its proper name: 'ActorBuffPtr'
1 parent 8495e84 commit 323ef13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+262
-262
lines changed

CONTRIBUTING.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
# General
1818

19-
Thank you for your interest in contributing to the XiEvents repository!
19+
Thank you for your interest in contributing to the XiEvents repository!
2020

21-
Before you begin submitting anything, we do ask that you take the time to review this document and make yourself aware of the various guidelines we ask all contributors to follow. Failing to follow the guidelines we have set in place will result in us asking you to change your pulls or have them flat out declined/closed.
21+
Before you begin submitting anything, we do ask that you take the time to review this document and make yourself aware of the various guidelines we ask all contributors to follow. Failing to follow the guidelines we have set in place will result in us asking you to change your pulls or have them flat out declined/closed.
2222

2323
Keeping the information on this repository clean, clear, and understandable is our goal.
2424

@@ -35,12 +35,12 @@ This repository and its work is for educational purposes only.
3535
We (contributors) do not claim ownership of any copyright content related to, or associated with, Final Fantasy XI.
3636

3737
```
38-
(c) 2002-2022 SQUARE ENIX CO., LTD. All Rights Reserved. Title Design by Yoshitaka Amano.
39-
FINAL FANTASY, TETRA MASTER and VANA'DIEL are registered trademarks of Square Enix Co., Ltd. SQUARE ENIX,
38+
(c) 2002-2022 SQUARE ENIX CO., LTD. All Rights Reserved. Title Design by Yoshitaka Amano.
39+
FINAL FANTASY, TETRA MASTER and VANA'DIEL are registered trademarks of Square Enix Co., Ltd. SQUARE ENIX,
4040
PLAYONLINE and the PlayOnline logo are trademarks of Square Enix Co., Ltd.
4141
```
4242

43-
The reverse engineering done by this repository and its contributors is entirely 'clean room'.
43+
The reverse engineering done by this repository and its contributors is entirely 'clean room'.
4444

4545
We DO NOT have or use any leaked source code or other unpublished material. By contributing to this repository, you agree to the following:
4646

@@ -71,7 +71,7 @@ _If you have any material you are unsure of being safe to reference, you can con
7171

7272
Before you plan to submit any issues or pull requests, we do ask that you get familiar with the repository first and the various file formats/layouts being used. The information presented in this repository is generally kept organized in various specific manners, and we do ask that any pull requests or changes being submitted follow the same formats.
7373

74-
If you feel a very large change should take place, then please open an issue for discussion as a proposal.
74+
If you feel a very large change should take place, then please open an issue for discussion as a proposal.
7575

7676
## Tooling Information
7777

@@ -103,7 +103,7 @@ If you are looking to submit a new issue or pull request, we ask that you follow
103103
3. Be sure to use the included templates, if one exists.
104104
* _When submitting issues and pulls, there may be an existing template you can use. Please be sure to use them and properly fill them out when submitting anything._
105105

106-
When submitting a new issue or pull request, please be sure to include as much detail as possible. Please do not be vague or non-responsive if you are asked to give more details, otherwise your submissions will be rejected.
106+
When submitting a new issue or pull request, please be sure to include as much detail as possible. Please do not be vague or non-responsive if you are asked to give more details, otherwise your submissions will be rejected.
107107

108108
If you are submitting a change/fix, please explain why. If you are submitting new information, new reversed data, or similar, please show your work, and be informative. Please do not guess at what things are/do. If you are unsure of parts of what you have reversed, please be clear about it. It is not helpful for the project to have guessed namings or similar that are potentially wrong and misleading. It is better to mark the data as unknown and needs to be further researched instead.
109109

@@ -146,7 +146,7 @@ _Pointer namings are used for objects, globals, arrays, etc._
146146
* Globals that the game prefixes with `g_` should still be prefixed with `PTR_`. (ie. `g_xiFileManager` should be named `PTR_g_xiFileManager`)
147147
* Unknown pointers in pseudo code should be named `PTR_UnknownObject` or similar. _(Best to leave a comment explaining what it is/potentially is as well.)_
148148

149-
In some cases, some official names are not really ideal. For example, one that I personally dislike is `ActerBuffPtr`. This is the entity map object that holds a pointer to all valid entities. Instead, the name `PTR_EntityMap` is used instead.
149+
In some cases, some official names are not really ideal. For example, one that I personally dislike is `ActerBuffPtr`. This is the entity map object that holds a pointer to all valid entities. Instead, the name `PTR_ActorBuffPtr` is used instead.
150150

151151
_If you rename a pointer that has an official known name, please be sure to add a comment above the pointer stating what the official, unedited, name is._
152152

@@ -269,7 +269,7 @@ if (FUNC_SomeCall()) {
269269
Brackets used for switch casing should be aligned to the case label. `break`, `continue` and `return` statements should be within the brackets. Brackets should generally always be present.
270270

271271
```cpp
272-
// Correct ✔️
272+
// Correct ✔️
273273
switch (x)
274274
{
275275
case 0:
@@ -310,7 +310,7 @@ switch (x)
310310
Short / small functions should always be written out. They should not be inlined into a single line.
311311

312312
```cpp
313-
// Correct ✔️
313+
// Correct ✔️
314314
void FUNC_Derp(void)
315315
{
316316
FUNC_Herp();

OpCodes/0x001D.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ void __thiscall FUNC_XiEvent_OpCode_0x001D(xievent_t* this)
1818
{
1919
char buffer[64]{};
2020
char* name = nullptr;
21-
21+
2222
PTR_CliEventMessOpenFlag = 1;
2323

24-
const auto entity = PTR_EntityMap[this->EntityTargetIndex[1]];
24+
const auto entity = PTR_ActorBuffPtr[this->EntityTargetIndex[1]];
2525
if (entity)
2626
{
2727
if (entity->MonstrosityFlag)

OpCodes/0x001E.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x001E(xievent_t* this)
2626

2727
if (ret)
2828
{
29-
const auto entity = PTR_EntityMap[index];
29+
const auto entity = PTR_ActorBuffPtr[index];
3030
if (entity)
3131
{
3232
if ((entity->Render.Flags0 & 0x80) != 0)

OpCodes/0x001F.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x001F(xievent_t* this)
3030
const auto val1 = this->ReqStack[this->RunPos].MovePosition[0] - this->ExtData[1]->EventPos[0];
3131
const auto val2 = this->ReqStack[this->RunPos].MovePosition[1] - this->ExtData[1]->EventPos[1];
3232
const auto val3 = this->ReqStack[this->RunPos].MovePosition[2] - this->ExtData[1]->EventPos[2];
33-
33+
3434
this->ExtData[1]->EventDir[1] = atan2(-val3, val1);
3535

3636
const auto val4 = sqrt(val3 * val3 + val1 * val1);
@@ -54,12 +54,12 @@ void __thiscall FUNC_XiEvent_OpCode_0x001F(xievent_t* this)
5454
this->RetFlag = 1;
5555
this->ExtData[1]->EventPos[1] = this->ReqStack[this->RunPos].MovePosition[1];
5656

57-
PTR_EntityMap[this->EntityTargetIndex[1]]->Render.Flags1 |= 0x20000;
57+
PTR_ActorBuffPtr[this->EntityTargetIndex[1]]->Render.Flags1 |= 0x20000;
5858
}
5959
}
6060
else
6161
{
62-
FUNC_XiAtelBuff_TurnCancel(PTR_EntityMap[this->EntityTargetIndex[1]]);
62+
FUNC_XiAtelBuff_TurnCancel(PTR_ActorBuffPtr[this->EntityTargetIndex[1]]);
6363

6464
this->ReqStack[this->RunPos].MovePosition[0] = FUNC_XiEvent_getworkofs_(this, 2) * 0.001;
6565
this->ReqStack[this->RunPos].MovePosition[2] = FUNC_XiEvent_getworkofs_(this, 4) * 0.001;
@@ -68,7 +68,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x001F(xievent_t* this)
6868
this->ExecPointer += 8;
6969
}
7070

71-
const auto entity = PTR_EntityMap[this->EntityTargetIndex[1]];
71+
const auto entity = PTR_ActorBuffPtr[this->EntityTargetIndex[1]];
7272
if (entity && (entity->Render.Flags0 & 0x100000) == 0
7373
&& (entity->Render.Flags0 & 0x200000) == 0
7474
&& (entity->Render.Flags2 & 0x4000) == 0)

OpCodes/0x0022.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void __thiscall FUNC_XiAtelBuff_SetEventHideFlag(entity_t* this, uint8_t enabled
2121

2222
void __thiscall FUNC_XiEvent_OpCode_0x0022(xievent_t* this)
2323
{
24-
const auto entity = PTR_EntityMap[this->EntityTargetIndex[1]];
24+
const auto entity = PTR_ActorBuffPtr[this->EntityTargetIndex[1]];
2525
if (entity)
2626
entity->SetEventHideFlag(this->EventData[this->ExecPointer + 1]);
2727

OpCodes/0x0023.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x0023(xievent_t* this)
4242

4343
if (this->ExtData[1]->MouthIndex)
4444
{
45-
const auto entity = PTR_EntityMap[this->ExtData[1]->MouthIndex];
45+
const auto entity = PTR_ActorBuffPtr[this->ExtData[1]->MouthIndex];
4646
if (entity)
4747
{
4848
entity->MouthCounter = 0;

OpCodes/0x0027.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Description
1111

12-
Calls a helper `FUNC_REQSet` which in turn calls `XiEvent::ReqSet` after checking some conditions.
12+
Calls a helper `FUNC_REQSet` which in turn calls `XiEvent::ReqSet` after checking some conditions.
1313

1414
For more information on `XiEvent::ReqSet`, see: [XiEvent::ReqSet](../Event%20VM%20Functions.md#xieventreqset)
1515

@@ -24,8 +24,8 @@ int32_t __cdecl FUNC_REQSet(uint32_t serverId1, uint32_t serverId2, uint32_t tag
2424
if (!entity1 || !entity2)
2525
return -1;
2626

27-
const auto entity1 = PTR_EntityMap[*index1];
28-
const auto entity2 = PTR_EntityMap[*index2];
27+
const auto entity1 = PTR_ActorBuffPtr[*index1];
28+
const auto entity2 = PTR_ActorBuffPtr[*index2];
2929

3030
if (!entity1 || !entity2)
3131
return -1;

OpCodes/0x0028.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ int32_t __cdecl FUNC_REQSet(uint32_t serverId1, uint32_t serverId2, uint32_t tag
2727
if (!entity1 || !entity2)
2828
return -1;
2929

30-
const auto entity1 = PTR_EntityMap[*index1];
31-
const auto entity2 = PTR_EntityMap[*index2];
30+
const auto entity1 = PTR_ActorBuffPtr[*index1];
31+
const auto entity2 = PTR_ActorBuffPtr[*index2];
3232

3333
if (!entity1 || !entity2)
3434
return -1;
@@ -60,8 +60,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x0028(xievent_t* this)
6060

6161
if (index1 && index2)
6262
{
63-
const auto entity1 = PTR_EntityMap[*index1];
64-
const auto entity2 = PTR_EntityMap[*index2];
63+
const auto entity1 = PTR_ActorBuffPtr[*index1];
64+
const auto entity2 = PTR_ActorBuffPtr[*index2];
6565

6666
if (entity1 && entity2)
6767
{
@@ -77,7 +77,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x0028(xievent_t* this)
7777
}
7878
}
7979
}
80-
80+
8181
this->ReqStack[this->RunPos].ReqFlag = 0;
8282
this->ExecPointer += 7;
8383
return;

OpCodes/0x0029.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ int32_t __cdecl FUNC_REQSet(uint32_t serverId1, uint32_t serverId2, uint32_t tag
2525
if (!entity1 || !entity2)
2626
return -1;
2727

28-
const auto entity1 = PTR_EntityMap[*index1];
29-
const auto entity2 = PTR_EntityMap[*index2];
28+
const auto entity1 = PTR_ActorBuffPtr[*index1];
29+
const auto entity2 = PTR_ActorBuffPtr[*index2];
3030

3131
if (!entity1 || !entity2)
3232
return -1;
@@ -86,8 +86,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x0029(xievent_t* this)
8686

8787
if (ret && index1 && index2)
8888
{
89-
const auto entity1 = PTR_EntityMap[*index1];
90-
const auto entity2 = PTR_EntityMap[*index2];
89+
const auto entity1 = PTR_ActorBuffPtr[*index1];
90+
const auto entity2 = PTR_ActorBuffPtr[*index2];
9191

9292
if (entity1 && entity2)
9393
{
@@ -127,8 +127,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x0029(xievent_t* this)
127127
return;
128128
}
129129

130-
const auto entity1 = PTR_EntityMap[*index1];
131-
const auto entity2 = PTR_EntityMap[*index2];
130+
const auto entity1 = PTR_ActorBuffPtr[*index1];
131+
const auto entity2 = PTR_ActorBuffPtr[*index2];
132132

133133
if (!entity1 || !entity2)
134134
{

OpCodes/0x002A.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x002A(xievent_t* this)
3737
return;
3838
}
3939

40-
const auto entity1 = PTR_EntityMap[*index1];
41-
const auto entity2 = PTR_EntityMap[*index2];
40+
const auto entity1 = PTR_ActorBuffPtr[*index1];
41+
const auto entity2 = PTR_ActorBuffPtr[*index2];
4242

4343
if (!entity1 || !entity2)
4444
{

OpCodes/0x002B.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x002B(xievent_t* this)
3333

3434
PTR_CliEventMessOpenFlag = 1;
3535

36-
const auto entity = PTR_EntityMap[index];
36+
const auto entity = PTR_ActorBuffPtr[index];
3737
if (entity)
3838
{
3939
if (entity->MonstrosityFlag)

OpCodes/0x002C.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x002C(xievent_t* this)
3333
return;
3434
}
3535

36-
const auto entity1 = PTR_EntityMap[index1];
37-
const auto entity2 = PTR_EntityMap[index2];
36+
const auto entity1 = PTR_ActorBuffPtr[index1];
37+
const auto entity2 = PTR_ActorBuffPtr[index2];
3838

3939
if (!entity1 || !entity2)
4040
{

OpCodes/0x002D.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void __thiscall FUNC_XiEvent_OpCode_0x002D(xievent_t* this)
3333
return;
3434
}
3535

36-
const auto entity1 = PTR_EntityMap[index1];
37-
const auto entity2 = PTR_EntityMap[index2];
36+
const auto entity1 = PTR_ActorBuffPtr[index1];
37+
const auto entity2 = PTR_ActorBuffPtr[index2];
3838

3939
if (!entity1 || !entity2)
4040
{

OpCodes/0x002F.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x002F(xievent_t* this)
2222
const auto val = FUNC_XiEvent_eventgetcode2(this, 2);
2323
if (FUNC_XiEvent_GetActorIndex(this, val, &serverId, &index))
2424
{
25-
const auto entity = PTR_EntityMap[index];
25+
const auto entity = PTR_ActorBuffPtr[index];
2626
if (entity)
2727
entity->Render.Flags0 ^= (entity->Render.Flags0 ^ (this->EventData[this->ExecPointer + 1] << 19)) & 0x80000;
2828
}

OpCodes/0x0031.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void __thiscall FUNC_XiEvent_OpCode_0x0031(xievent_t* this)
2727
{
2828
if (!this->EventData[this->ExecPointer + 1])
2929
{
30-
FUNC_XiAtelBuff_TurnCancel(PTR_EntityMap[this->EntityTargetIndex[1]]);
30+
FUNC_XiAtelBuff_TurnCancel(PTR_ActorBuffPtr[this->EntityTargetIndex[1]]);
3131

3232
this->ReqStack[this->RunPos].MovePosition[0] = FUNC_XiEvent_getworkofs_(this, 2) * 0.001;
3333
this->ReqStack[this->RunPos].MovePosition[2] = FUNC_XiEvent_getworkofs_(this, 4) * 0.001;
@@ -41,9 +41,9 @@ void __thiscall FUNC_XiEvent_OpCode_0x0031(xievent_t* this)
4141
const auto val1 = this->ReqStack[this->RunPos].MovePosition[0] - this->ExtData[1]->EventPos[0];
4242
const auto val2 = this->ReqStack[this->RunPos].MovePosition[1] - this->ExtData[1]->EventPos[1];
4343
const auto val3 = this->ReqStack[this->RunPos].MovePosition[2] - this->ExtData[1]->EventPos[2];
44-
44+
4545
this->ExtData[1]->EventDir[1] = atan2(-val3, val1);
46-
46+
4747
const auto val4 = sqrt(val2 * val2 + val3 * val3 + val1 * val1);
4848

4949
if (!(this->ReqStack[this->RunPos].MoveTime <= 0))
@@ -71,10 +71,10 @@ void __thiscall FUNC_XiEvent_OpCode_0x0031(xievent_t* this)
7171
this->RetFlag = 1;
7272
this->ReqStack[this->RunPos].MoveTime = this->ReqStack[this->RunPos].MoveTime - FUNC_GetFrameDelay();
7373

74-
PTR_EntityMap[this->EntityTargetIndex[1]]->Render.Flags1 |= 0x20000;
74+
PTR_ActorBuffPtr[this->EntityTargetIndex[1]]->Render.Flags1 |= 0x20000;
7575
}
7676

77-
const auto entity = PTR_EntityMap[this->EntityTargetIndex[1]];
77+
const auto entity = PTR_ActorBuffPtr[this->EntityTargetIndex[1]];
7878
if (entity && (entity->Render.Flags0 & 0x100000) == 0
7979
&& (entity->Render.Flags0 & 0x200000) == 0
8080
&& (entity->Render.Flags2 & 0x4000) == 0)

OpCodes/0x0033.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Adjusts the event entities `Render.Flags0` value.
1616
```cpp
1717
void __thiscall FUNC_XiEvent_OpCode_0x0033(xievent_t* this)
1818
{
19-
const auto entity = PTR_EntityMap[this->EntityTargetIndex[1]];
19+
const auto entity = PTR_ActorBuffPtr[this->EntityTargetIndex[1]];
2020
if (entity)
2121
entity->Render.Flags0 ^= (entity->Render.Flags0 ^ (this->EventData[this->ExecPointer + 1] << 21)) & 0x200000;
2222

OpCodes/0x0034.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ void __thiscall FUNC_XiEvent_OpCode_0x0034(xievent_t* this)
3030
else
3131
{
3232
FUNC_UnknownCall(this);
33-
33+
3434
v2 = FUNC_XiEvent_getworkofs_(this, 1);
3535
FUNC_XiZone_Open(v2);
3636

3737
PTR_EventMapLoadFlag = 1;
3838
}
39-
39+
4040
PTR_UnknownValue0001 = 0;
41-
41+
4242
this->ExecPointer += 3;
4343
this->RetFlag = 1;
4444
}
@@ -52,13 +52,13 @@ void __thiscall FUNC_XiEvent_OpCode_0x0034(xievent_t* this)
5252
}
5353
else
5454
{
55-
auto entity = (uint32_t*)PTR_EntityMap;
55+
auto entity = (uint32_t*)PTR_ActorBuffPtr;
5656
do
5757
{
5858
if (*entity)
5959
FUNC_XiAtelBuff_ObjectDelete(*entity);
6060
++entity;
61-
} while(ptr < PTR_EntityMapEnd);
61+
} while(ptr < PTR_ActorBuffPtrEnd);
6262

6363
PTR_UnknownValue0001 = 0;
6464
PTR_UnknownValue0000++;

OpCodes/0x0035.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ void __thiscall FUNC_XiEvent_OpCode_0x0035(xievent_t* this)
2929

3030
v2 = FUNC_XiEvent_getworkofs_(this, 1);
3131
FUNC_XiZone_Open(v2);
32-
32+
3333
PTR_EventMapLoadFlag = 1;
3434
}
3535

3636
PTR_UnknownValue0001 = 0;
37-
37+
3838
this->ExecPointer += 3;
3939
this->RetFlag = 1;
4040
}
@@ -48,14 +48,14 @@ void __thiscall FUNC_XiEvent_OpCode_0x0035(xievent_t* this)
4848
}
4949
else
5050
{
51-
auto entity = (uint32_t*)PTR_EntityMap;
51+
auto entity = (uint32_t*)PTR_ActorBuffPtr;
5252
do
5353
{
5454
if (*entity)
5555
FUNC_XiAtelBuff_ObjectDelete(*entity);
5656
++entity;
57-
} while(ptr < PTR_EntityMapEnd);
58-
57+
} while(ptr < PTR_ActorBuffPtrEnd);
58+
5959
PTR_EventMapLoadFlag = 1;
6060
PTR_UnknownValue0000++;
6161

0 commit comments

Comments
 (0)