Skip to content
This repository was archived by the owner on Sep 24, 2023. It is now read-only.

Commit 584b8f5

Browse files
committed
Add support for CR-style linebreaks
The new L4D2 campaign has a level entity string that uses Mac-style line endings. The plugin didn't support this until now, so it was returning no entities, and passing that back to the server.
1 parent 5c0d491 commit 584b8f5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripting/level_keyvalues.sp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#pragma newdecls required
1919

20-
#define PLUGIN_VERSION "0.3.3"
20+
#define PLUGIN_VERSION "0.3.4"
2121
public Plugin myinfo = {
2222
name = "Level KeyValues",
2323
author = "nosoop",
@@ -216,7 +216,8 @@ static ArrayList ParseEntityList(const char mapEntities[2097152]) {
216216
int SplitStringOnNewLine(const char[] str, char[] buffer, int maxlen) {
217217
int b;
218218
char c;
219-
while ((c = str[b]) != '\0' && c != '\n') {
219+
while ((c = str[b]) != '\0' && c != '\n'
220+
&& c != '\r' /* really? what the fuck are you doing, L4D2? */) {
220221
b++;
221222
}
222223
if (!str[b]) {

0 commit comments

Comments
 (0)