MantisBT - Zandronum |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0001844 | Zandronum | [All Projects] Bug | public | 2014-06-17 18:41 | 2024-04-08 17:24 |
|
Reporter | Zom-B | |
Assigned To | | |
Priority | low | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | |
Platform | Microsoft | OS | Windows | OS Version | XP/Vista/7 |
Product Version | 1.2 | |
Target Version | 3.2 | Fixed in Version | 3.2 | |
|
Summary | 0001844: DMflags2 shotgun crashes when shotgun actor is replaced |
Description | I have a mod where in DECORATE the Shotgun actor is replaced with ShellBox and the DoomPlayer actor is overridden with only custom weapons in Player.StartItem and Player.StartItem. The KeyConf file uses the new class which is evident in the game.
When dmflags2 has bit 2048 (Start with Shotgun), it bugs out at startup. |
Steps To Reproduce | Make a resource file (pk3)
Put in DECORATE:
ACTOR MarineClass : DoomPlayer
{
Player.WeaponSlot 2, Pistol
Player.StartItem "Pistol"
}
ACTOR MShotgunButAmmo : ShellBox Replaces Shotgun
{
}
Put in KEYCONF:
clearplayerclasses
addplayerclass MarineClass
Start Zandromun with the DOOM2.wad and this pk3, and with dmflags2=2048 |
Additional Information | |
Tags | Access Violation, decorate, DMFLAG, shotgun, weapon |
Relationships | child of | 0001845 | closed | Dusk | make sv_shotgunstart work in all games and gamemodes |
|
Attached Files | CrashReport.zip (19,718) 2014-06-17 18:41 https://zandronum.com/tracker/file_download.php?file_id=1232&type=bug
MOD.pk3 (384) 2014-06-17 18:47 https://zandronum.com/tracker/file_download.php?file_id=1233&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2014-06-17 18:41 | Zom-B | New Issue | |
2014-06-17 18:41 | Zom-B | File Added: CrashReport.zip | |
2014-06-17 18:47 | Zom-B | File Added: MOD.pk3 | |
2014-06-18 00:37 | Dusk | Assigned To | => Dusk |
2014-06-18 00:37 | Dusk | Status | new => assigned |
2014-06-18 13:18 | Dusk | Note Added: 0009572 | |
2014-06-18 13:18 | Dusk | Status | assigned => needs review |
2014-06-18 13:19 | Dusk | Relationship added | child of 0001845 |
2014-06-21 14:46 | Torr Samaho | Note Added: 0009618 | |
2014-06-21 14:46 | Torr Samaho | Status | needs review => feedback |
2014-06-21 15:49 | Zom-B | Note Added: 0009622 | |
2014-06-21 15:49 | Zom-B | Status | feedback => assigned |
2014-06-21 15:49 | Zom-B | Note Edited: 0009622 | bug_revision_view_page.php?bugnote_id=9622#r5094 |
2014-06-21 19:04 | Dusk | Note Added: 0009628 | |
2014-06-21 19:04 | Dusk | Status | assigned => needs review |
2014-06-21 19:04 | Dusk | Note Edited: 0009628 | bug_revision_view_page.php?bugnote_id=9628#r5100 |
2014-06-22 06:51 | Torr Samaho | Note Added: 0009639 | |
2014-06-22 06:53 | Torr Samaho | Note Edited: 0009639 | |
2014-06-22 06:53 | Torr Samaho | Note Edited: 0009639 | bug_revision_view_page.php?bugnote_id=9639#r5117 |
2014-06-22 06:53 | Torr Samaho | Note Revision Dropped: 9639: 0005116 | |
2014-06-22 06:53 | Torr Samaho | Note Revision Dropped: 9639: 0005115 | |
2014-06-22 06:53 | Torr Samaho | Status | needs review => feedback |
2014-06-22 10:31 | Dusk | Note Added: 0009646 | |
2014-07-05 20:06 | Torr Samaho | Product Version | 2.0-beta => 1.2 |
2024-03-19 17:05 | Ru5tK1ng | Note Added: 0023430 | |
2024-03-19 17:05 | Ru5tK1ng | Assigned To | Dusk => |
2024-03-19 17:05 | Ru5tK1ng | Status | feedback => needs review |
2024-04-07 20:30 | Ru5tK1ng | Note Added: 0023527 | |
2024-04-07 20:30 | Ru5tK1ng | Status | needs review => resolved |
2024-04-07 20:30 | Ru5tK1ng | Target Version | => 3.2 |
2024-04-07 20:30 | Ru5tK1ng | Status | resolved => feedback |
2024-04-07 20:30 | Ru5tK1ng | Resolution | open => reopened |
2024-04-07 20:30 | Ru5tK1ng | Status | feedback => needs testing |
2024-04-08 17:24 | Ru5tK1ng | Note Added: 0023547 | |
2024-04-08 17:24 | Ru5tK1ng | Status | needs testing => resolved |
2024-04-08 17:24 | Ru5tK1ng | Resolution | reopened => fixed |
2024-04-08 17:24 | Ru5tK1ng | Fixed in Version | => 3.2 |
Notes |
|
(0009572)
|
Dusk
|
2014-06-18 13:18
|
|
|
|
|
The part of your patch which prevents the crash reported here (aka the ( pInventory->IsKindOf( RUNTIME_CLASS( AWeapon ) ) check) looks fine. If you separate it from the rest, I'll pull it. |
|
|
(0009622)
|
Zom-B
|
2014-06-21 15:49
|
|
i merely reported it for completeness (and because bugs I encounter are rarely reproducible). Don't sweat it. There are FAR more pressing bugs, like 0001469
|
|
|
(0009628)
|
Dusk
|
2014-06-21 19:04
|
|
|
|
(0009639)
|
Torr Samaho
|
2014-06-22 06:51
(edited on: 2014-06-22 06:53) |
|
Are you sure that
if (( ammo = shotgun->Ammo1 ) != NULL )
ammo->Amount = shotgun->AmmoGive1 * 2;
is guaranteed to work? In similar code, like the LMS stuff, we always use
if ( pWeapon->Ammo1 )
{
pInventory = player->mo->FindInventory( pWeapon->Ammo1->GetClass( ));
if ( pInventory != NULL )
pInventory->Amount = ...
The way you define and initialize shotgunclass is not totally straight forward to read. IMO the code would be much more readable if definition and initialization are combined to
const PClass* shotgunclass = PClass::FindClass( "Shotgun" )->ActorInfo->GetReplacement()->Class
, moved inside the scope that checks DF2_COOP_SHOTGUNSTART and a new scope for the "is weapon" check is created.
Also, if you insist on changing the behavior of the flag to make it work in non-coop game modes, fine. But then the "COOP" in the internal flag name doesn't make any sense anymore and needs to be removed.
|
|
|
(0009646)
|
Dusk
|
2014-06-22 10:31
|
|
Quote
Are you sure that
if (( ammo = shotgun->Ammo1 ) != NULL )
ammo->Amount = shotgun->AmmoGive1 * 2;
is guaranteed to work? In similar code, like the LMS stuff, we always use
ZDoom seems to do this.. see for instance g_hexen/a_fighteraxe.cpp:
g_hexen/a_fighteraxe.cpp:79: if (player->ReadyWeapon->Ammo1->Amount)
g_hexen/a_fighteraxe.cpp:103: if (player->ReadyWeapon->Ammo1->Amount <= 0)
g_hexen/a_fighteraxe.cpp:127: if (player->ReadyWeapon->Ammo1->Amount)
g_hexen/a_fighteraxe.cpp:151: if (player->ReadyWeapon->Ammo1->Amount <= 0)
g_hexen/a_fighteraxe.cpp:175: if (player->ReadyWeapon->Ammo1->Amount)
g_hexen/a_fighteraxe.cpp:210: if (player->ReadyWeapon->Ammo1->Amount > 0)
g_hexen/a_fighteraxe.cpp:311: if ((weapon->Ammo1 == NULL || weapon->Ammo1->Amount == 0) &&
It worked just fine for me when I tested it offline and online.
Quote Also, if you insist on changing the behavior of the flag to make it work in non-coop game modes, fine.
It doesn't make any sense to me to keep it coop-only. I think there was a ticket somewhere in here that proposed to make it available to all game modes but I cannot find it right now..
I'll work on the readability. |
|
|
|
|
|
|
|
|
|
Tested with the latest beta and the crash no longer occurs with the example wad. |
|