Skip to content

Commit 2e65e4c

Browse files
Event parser: add edge case of Canceling header name
1 parent 7a499dd commit 2e65e4c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

events/Ped/onPedDamage.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ examples:
1515
description: This example outputs a message to the console when a specific ped is
1616
damaged.
1717
side: server
18+
canceling: Canceling this event has no effect. Cancel the client-side event onClientPedDamage
19+
instead.

events/Weapon_creation/onClientWeaponFire.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ examples:
4141
- path: examples/onClientWeaponFire-1.lua
4242
description: This example prevents player damage from custom weapons.
4343
side: client
44+
canceling: If this event was canceled, then the weapon will not fire.

migrate/oldwiki/copy_files.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def copy_files(source_dir, target_dir):
3030
print(f"(YAML) Copying {src_path} to {dest_path}")
3131
with open(src_path, 'r', encoding='utf-8') as src_file:
3232
with open(dest_path, 'w', encoding='utf-8') as dest_file:
33-
dest_file.write(src_file.read())
33+
src_file_content = src_file.read()
34+
# Hack: replace name: y with name: "y"
35+
# because that's a YAML reserved keyword xD
36+
src_file_content = src_file_content.replace("name: y", 'name: "y"')
37+
dest_file.write(src_file_content)
3438

3539
elif file.endswith(".lua"):
3640
# Copy all .lua files too

0 commit comments

Comments
 (0)