Skip to content

Commit

Permalink
Fix character duplicating when no hair
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Dec 19, 2022
1 parent 974f53c commit b31663b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ ENDIF()

if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 -WX -wd\"4996\" -wd\"4204\"")
if(DEBUG)
ADD_DEFINITIONS(-ZI)
endif()
else()
add_definitions(
-fsigned-char
Expand Down
18 changes: 12 additions & 6 deletions missions/custom/techdemo/cyberdogs.cdogscpn/ammo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Pic": "bullet_pickup"
},
"Sound": "bullet_pickup",
"Amount": 100
"Amount": 100,
"Price": 600
},
{
"Name": "Grenades",
Expand All @@ -17,7 +18,8 @@
"Pic": "grenade_pickup"
},
"Sound": "grenade_pickup",
"Amount": 10
"Amount": 10,
"Price": 300
},
{
"Name": "Cells",
Expand All @@ -27,7 +29,8 @@
"TicksPerFrame": 10
},
"Sound": "cells_pickup",
"Amount": 10
"Amount": 10,
"Price": 100
},
{
"Name": "Mini cells",
Expand All @@ -37,7 +40,8 @@
"TicksPerFrame": 10
},
"Sound": "mini_cells_pickup",
"Amount": 50
"Amount": 50,
"Price": 500
},
{
"Name": "Rockets",
Expand All @@ -46,7 +50,8 @@
"Pic": "rockets"
},
"Sound": "grenade_pickup",
"Amount": 10
"Amount": 10,
"Price": 1000
},
{
"Name": "Gas tank",
Expand All @@ -55,7 +60,8 @@
"Pic": "gas_tank"
},
"Sound": "gas_tank_pickup",
"Amount": 100
"Amount": 100,
"Price": 500
}
]
}
56 changes: 56 additions & 0 deletions missions/custom/techdemo/cyberdogs.cdogscpn/characters.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,61 @@
"probabilityToTrack": 25,
"probabilityToShoot": 0,
"actionDelay": 15
},
{
"Class": "Jones",
"PlayerTemplateName": "Jones",
"Skin": "f0944bff",
"Arms": "5050a0ff",
"Body": "5050a0ff",
"Legs": "5050a0ff",
"Hair": "000000ff",
"Feet": "5050a0ff",
"speed": 256,
"Gun": "Machine gun",
"maxHealth": 40,
"flags": 1024,
"probabilityToMove": 50,
"probabilityToTrack": 25,
"probabilityToShoot": 2,
"actionDelay": 15
},
{
"Class": "Jones",
"PlayerTemplateName": "Ice",
"HairType": "shades",
"Skin": "f0944bff",
"Arms": "5050a0ff",
"Body": "5050a0ff",
"Legs": "5050a0ff",
"Hair": "000000ff",
"Feet": "5050a0ff",
"speed": 256,
"Gun": "Machine gun",
"maxHealth": 40,
"flags": 1024,
"probabilityToMove": 50,
"probabilityToTrack": 25,
"probabilityToShoot": 2,
"actionDelay": 15
},
{
"Class": "Jones",
"PlayerTemplateName": "WarBaby",
"HairType": "beret",
"Skin": "f0944bff",
"Arms": "5050a0ff",
"Body": "5050a0ff",
"Legs": "5050a0ff",
"Hair": "f30202ff",
"Feet": "5050a0ff",
"speed": 256,
"Gun": "Machine gun",
"maxHealth": 40,
"flags": 1024,
"probabilityToMove": 50,
"probabilityToTrack": 25,
"probabilityToShoot": 2,
"actionDelay": 15
}]
}
33 changes: 22 additions & 11 deletions missions/custom/techdemo/cyberdogs.cdogscpn/guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"Lock": 0,
"Sound": "",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Price": 2000
},
{
"Pic": "chainsaw",
Expand All @@ -21,7 +22,8 @@
"Lock": 0,
"Sound": "",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Price": 2000
},
{
"Pic": "chainsaw",
Expand All @@ -32,7 +34,8 @@
"Lock": 0,
"Sound": "",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Price": 2000
},
{
"Pic": "chainsaw",
Expand All @@ -43,7 +46,8 @@
"Lock": 0,
"Sound": "",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Price": 2000
},
{
"Pic": "chainsaw",
Expand All @@ -54,7 +58,8 @@
"Lock": 0,
"Sound": "",
"SoundLockLength": 50,
"CanShoot": false
"CanShoot": false,
"Price": 2000
},
{
"Pic": "",
Expand All @@ -79,7 +84,8 @@
"SwitchSound": "mg_switch",
"MuzzleFlashParticle": "muzzle_flash_mg",
"Brass": "brass_big",
"Ammo": "Bullets"
"Ammo": "Bullets",
"Price": 3100
},
{
"Pic": "launcher",
Expand All @@ -90,7 +96,8 @@
"Sound": "bottle_pop",
"SwitchSound": "swarmer_switch",
"Elevation": 14,
"Ammo": "Grenades"
"Ammo": "Grenades",
"Price": 2800
},
{
"Pic": "flamer",
Expand All @@ -103,7 +110,8 @@
"SwitchSound": "flamer_switch",
"SoundLockLength": 36,
"MuzzleFlashParticle": "muzzle_flash_flamer",
"Ammo": "Gas tank"
"Ammo": "Gas tank",
"Price": 3000
},
{
"Name": "Powergun",
Expand All @@ -113,7 +121,8 @@
"Sound": "fusion",
"SwitchSound": "powergun_switch",
"MuzzleFlashParticle": "muzzle_flash_powergun",
"Ammo": "Cells"
"Ammo": "Cells",
"Price": 2100
},
{
"Pic": "blaster_yellow",
Expand Down Expand Up @@ -144,7 +153,8 @@
"Sound": "pistol",
"SwitchSound": "pulse_switch",
"MuzzleFlashParticle": "muzzle_flash_pulse",
"Ammo": "Mini cells"
"Ammo": "Mini cells",
"Price": 1500
},
{
"Pic": "rifle",
Expand All @@ -160,7 +170,8 @@
"Shake": {
"Amount": 8,
"CameraSubjectOnly": true
}
},
"Price": 6500
},
{
"Name": "DumbGun",
Expand Down
5 changes: 4 additions & 1 deletion src/cdogsed/char_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,10 @@ static void AddCharacter(EditorContext *ec, const int cloneIdx)
{
CSTRDUP(ec->Char->PlayerTemplateName, clone->PlayerTemplateName);
}
CSTRDUP(ec->Char->Hair, clone->Hair);
if (clone->Hair)
{
CSTRDUP(ec->Char->Hair, clone->Hair);
}
CMALLOC(ec->Char->bot, sizeof *ec->Char->bot);
memcpy(ec->Char->bot, clone->bot, sizeof *ec->Char->bot);
}
Expand Down

0 comments on commit b31663b

Please sign in to comment.