Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit f448221

Browse files
committed
I DONT KNOW WHAT IM DOING
1 parent 9a4a606 commit f448221

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

byond-extools/src/core/core.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,10 @@ void Core::Alert(int what)
119119
}
120120

121121
unsigned int Core::GetStringId(std::string str, bool increment_refcount) {
122-
switch (ByondVersion) {
123-
case 512:
124-
{
125-
int idx = GetStringTableIndex(str.c_str(), 0, 1);
126-
if (increment_refcount)
127-
{
128-
String* str = GetStringTableEntry(idx);
129-
str->refcount++;
130-
}
131-
return idx; //this could cause memory problems with a lot of long strings but otherwise they get garbage collected after first use.
132-
}
133-
case 513 ... 514:
134-
return GetStringTableIndexUTF8(str.c_str(), 0xFFFFFFFF, 0, 1);
135-
default: break;
122+
if (ByondVersion > 513) {
123+
return GetStringTableIndexUTF8(str.c_str(), 0xFFFFFFFF, 0, 1);
124+
else
125+
break;
136126
}
137127
return 0;
138128
}

byond-extools/src/core/find_functions.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,11 @@ bool Core::find_functions()
8282
FIND_OR_DIE(InitializeListFromContext, "55 8B EC 56 FF 75 08 E8 ?? ?? ?? ?? 8B F0 83 C4 04 85 F6 74 2A 8B ?? ?? ?? ?? ?? 0F B7 4E 0C 66 29 4A 42 8B 46 0C");
8383
FIND_OR_DIE(DestroyList, "55 8B EC A1 ?? ?? ?? ?? 56 57 8B 7D 08 8B 34 B8 85 F6 0F 84 ?? ?? ?? ?? 83 7E 10 00 74 1A 6A 0F 57");
8484
FIND_OR_DIE(DestroyDatum, "55 8B EC 8B 55 10 0F B6 C2 83 C0 FE 83 F8 1F 0F 87 ?? ?? ?? ?? 0F B6 ?? ?? ?? ?? ?? FF 24 ?? ?? ?? ?? ?? 8B 4D 14 3B ?? ?? ?? ?? ?? 0F 83 ?? ?? ?? ?? A1 ?? ?? ?? ?? 8B 04 88 85 C0 0F 84");
85-
switch(ByondVersion) {
86-
case 512:
87-
FIND_OR_DIE(GetStringTableIndex, "55 8B EC 8B 45 ?? 83 EC ?? 53 8B 1D ?? ?? ?? ??");
88-
break;
89-
case 513 ... 514:
90-
FIND_OR_DIE(GetStringTableIndexUTF8, "55 8B EC 8B 45 ?? 83 EC ?? 53 56 8B 35 ?? ?? ?? ??");
91-
break;
92-
default: break;
85+
if(ByondVersion > 513) {
86+
FIND_OR_DIE(GetStringTableIndexUTF8, "55 8B EC 8B 45 ?? 83 EC ?? 53 56 8B 35 ?? ?? ?? ??");
87+
break;
88+
else
89+
break;
9390
}
9491
if(failed) return false;
9592
int offset = *(int*)((char*)TopicFloodCheck + 0x2C);

0 commit comments

Comments
 (0)