mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- Fixed: skins can not be sorted for binary search because the player class
code depends on the original indices. - Fixed: P_StartConversation set the global dialog node variable for all players, not just the consoleplayer. - Fixed: AWeapon::PickupForAmmo assumed that any weapon having a secondary ammo type also has a primary one. SVN r1431 (trunk)
This commit is contained in:
parent
4b723beddd
commit
5bd3d0d37d
4 changed files with 116 additions and 81 deletions
|
@ -1,4 +1,12 @@
|
|||
February 20, 2009 (Changes by Graf Zahl)
|
||||
February 21, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: skins can not be sorted for binary search because the player class
|
||||
code depends on the original indices.
|
||||
- Fixed: P_StartConversation set the global dialog node variable for all
|
||||
players, not just the consoleplayer.
|
||||
- Fixed: AWeapon::PickupForAmmo assumed that any weapon having a secondary
|
||||
ammo type also has a primary one.
|
||||
|
||||
February 20, 2009 (Changes by Graf Zahl)
|
||||
- Bumped netgame, demo and min demo version for the weapon slot changes.
|
||||
- changed weapon slots to be stored per player. Information is now transmitted
|
||||
across the network so that all machines know each player's current weapon
|
||||
|
|
|
@ -163,17 +163,26 @@ bool AWeapon::PickupForAmmo (AWeapon *ownedWeapon)
|
|||
// Don't take ammo if the weapon sticks around.
|
||||
if (!ShouldStay ())
|
||||
{
|
||||
int oldamount = 0;
|
||||
if (ownedWeapon->Ammo1 != NULL) oldamount = ownedWeapon->Ammo1->Amount;
|
||||
int oldamount1 = 0;
|
||||
int oldamount2 = 0;
|
||||
if (ownedWeapon->Ammo1 != NULL) oldamount1 = ownedWeapon->Ammo1->Amount;
|
||||
if (ownedWeapon->Ammo2 != NULL) oldamount2 = ownedWeapon->Ammo1->Amount;
|
||||
|
||||
if (AmmoGive1 > 0) gotstuff = AddExistingAmmo (ownedWeapon->Ammo1, AmmoGive1);
|
||||
if (AmmoGive2 > 0) gotstuff |= AddExistingAmmo (ownedWeapon->Ammo2, AmmoGive2);
|
||||
|
||||
AActor *Owner = ownedWeapon->Owner;
|
||||
if (gotstuff && oldamount == 0 && Owner != NULL && Owner->player != NULL)
|
||||
if (gotstuff && Owner != NULL && Owner->player != NULL)
|
||||
{
|
||||
if (ownedWeapon->Ammo1 != NULL && oldamount1 == 0)
|
||||
{
|
||||
static_cast<APlayerPawn *>(Owner)->CheckWeaponSwitch(ownedWeapon->Ammo1->GetClass());
|
||||
}
|
||||
else if (ownedWeapon->Ammo2 != NULL && oldamount2 == 0)
|
||||
{
|
||||
static_cast<APlayerPawn *>(Owner)->CheckWeaponSwitch(ownedWeapon->Ammo2->GetClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
return gotstuff;
|
||||
}
|
||||
|
|
|
@ -676,7 +676,7 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
|||
pc->player->ConversationPC = pc;
|
||||
pc->player->ConversationNPC = npc;
|
||||
|
||||
CurNode = npc->Conversation;
|
||||
FStrifeDialogueNode *CurNode = npc->Conversation;
|
||||
|
||||
if (pc->player == &players[consoleplayer])
|
||||
{
|
||||
|
@ -717,16 +717,17 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
|||
}
|
||||
}
|
||||
|
||||
// The rest is only done when the conversation is actually displayed.
|
||||
if (pc->player == &players[consoleplayer])
|
||||
{
|
||||
if (CurNode->SpeakerVoice != 0)
|
||||
{
|
||||
I_SetMusicVolume (dlg_musicvolume);
|
||||
S_Sound (npc, CHAN_VOICE|CHAN_NOPAUSE, CurNode->SpeakerVoice, 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
if (pc->player != &players[consoleplayer])
|
||||
return;
|
||||
|
||||
// Set up the menu
|
||||
::CurNode = CurNode; // only set the global variaböle for the consoleplayer
|
||||
ConversationMenu.PreDraw = DrawConversationMenu;
|
||||
ConversationMenu.EscapeHandler = ConversationMenuEscaped;
|
||||
|
||||
|
@ -799,6 +800,7 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
|||
menuactive = MENU_OnNoPause;
|
||||
ConversationPauseTic = gametic + 20;
|
||||
M_SwitchMenu (&ConversationMenu);
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
@ -419,10 +419,12 @@ static const char *skinsoundnames[NUMSKINSOUNDS][2] =
|
|||
{ "dsjump", "*jump" }
|
||||
};
|
||||
|
||||
/*
|
||||
static int STACK_ARGS skinsorter (const void *a, const void *b)
|
||||
{
|
||||
return stricmp (((FPlayerSkin *)a)->name, ((FPlayerSkin *)b)->name);
|
||||
}
|
||||
*/
|
||||
|
||||
void R_InitSkins (void)
|
||||
{
|
||||
|
@ -782,6 +784,19 @@ int R_FindSkin (const char *name, int pclass)
|
|||
return pclass;
|
||||
}
|
||||
|
||||
for (unsigned i = PlayerClasses.Size(); i < numskins; i++)
|
||||
{
|
||||
if (strnicmp (skins[i].name, name, 16) == 0)
|
||||
{
|
||||
if (PlayerClasses[pclass].CheckSkin (mid))
|
||||
return i;
|
||||
else
|
||||
return pclass;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
min = PlayerClasses.Size ();
|
||||
max = (int)numskins-1;
|
||||
|
||||
|
@ -805,6 +820,7 @@ int R_FindSkin (const char *name, int pclass)
|
|||
max = mid - 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
return pclass;
|
||||
}
|
||||
|
||||
|
@ -932,7 +948,7 @@ void R_InitSprites ()
|
|||
}
|
||||
|
||||
// [RH] Sort the skins, but leave base as skin 0
|
||||
qsort (&skins[PlayerClasses.Size ()], numskins-PlayerClasses.Size (), sizeof(FPlayerSkin), skinsorter);
|
||||
//qsort (&skins[PlayerClasses.Size ()], numskins-PlayerClasses.Size (), sizeof(FPlayerSkin), skinsorter);
|
||||
}
|
||||
|
||||
void R_DeinitSprites()
|
||||
|
|
Loading…
Reference in a new issue