Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
August 6th Patch Update
Browse files Browse the repository at this point in the history
Accumulated DLL source code changes since June 22nd patch
  • Loading branch information
PG-SteveT committed Aug 6, 2020
1 parent 93a1af2 commit ae72fce
Show file tree
Hide file tree
Showing 76 changed files with 1,071 additions and 210 deletions.
2 changes: 1 addition & 1 deletion CnCRemastered.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1022
Expand Down
4 changes: 2 additions & 2 deletions REDALERT/ADATA.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static AnimTypeClass const LZSmoke(
72, // Loop start frame number.
91, // Ending frame of loop back.
-1, // Number of animation stages.
255, // Number of times the animation loops.
127, // Number of times the animation loops.
VOC_NONE, // Sound effect to play.
ANIM_NONE
);
Expand Down Expand Up @@ -1127,7 +1127,7 @@ static AnimTypeClass const OilFieldBurn(
33, // Loop start frame number.
99, // Ending frame of loop back.
66, // Number of animation stages.
65535, // Number of times the animation loops.
127, // Number of times the animation loops.
VOC_NONE, // Sound effect to play.
ANIM_NONE
);
Expand Down
19 changes: 14 additions & 5 deletions REDALERT/AIRCRAFT.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -1948,9 +1948,17 @@ void AircraftClass::Enter_Idle_Mode(bool )
/*
** Normal aircraft try to find a good landing spot to rest.
*/
BuildingClass * building = Find_Docking_Bay(Class->Building, false);
BuildingClass * building = NULL;
if (In_Radio_Contact() && Contact_With_Whom()->What_Am_I() == RTTI_BUILDING) {
building = (BuildingClass *)Contact_With_Whom();
} else {
building = Find_Docking_Bay(Class->Building, false);
if (Transmit_Message(RADIO_HELLO, building) != RADIO_ROGER) {
building = NULL;
}
}
Assign_Destination(TARGET_NONE);
if (building != NULL && Transmit_Message(RADIO_HELLO, building) == RADIO_ROGER) {
if (building != NULL) {
if (Class->IsFixedWing) {
Status = 0; //BG - reset the mission status to avoid landing on the ground next to the airstrip
if (IsLanding) {
Expand Down Expand Up @@ -2367,7 +2375,7 @@ ActionType AircraftClass::What_Action(CELL cell) const
ActionType action = FootClass::What_Action(cell);

//using function for IsVisible so we have different results for different players - JAS 2019/09/30
if (action == ACTION_MOVE && !Map[cell].Is_Visible(PlayerPtr)) {
if ((action == ACTION_MOVE || action == ACTION_ATTACK) && !Map[cell].Is_Visible(PlayerPtr)) {
action = ACTION_NOMOVE;
}

Expand Down Expand Up @@ -3068,7 +3076,7 @@ MoveType AircraftClass::Can_Enter_Cell(CELL cell, FacingType ) const
if (occupier == NULL ||
!occupier->Is_Techno() ||
((TechnoClass *)occupier)->House->Is_Ally(House) ||
(((TechnoClass *)occupier)->Cloak != CLOAKED &&
(!((TechnoClass *)occupier)->Is_Cloaked(this) &&
(ScenarioInit == 0 && (occupier->What_Am_I() != RTTI_BUILDING || !((BuildingClass*)occupier)->Class->IsInvisible)) )
) {

Expand Down Expand Up @@ -3128,9 +3136,10 @@ TARGET AircraftClass::Good_Fire_Location(TARGET target) const
for (int face = 0; face < 255; face += 16) {
COORDINATE newcoord = Coord_Move(tcoord, (DirType)face, r);
CELL newcell = Coord_Cell(newcoord);
CELL actualcell = Coord_Cell(Coord_Sub(newcoord, XY_Coord(0, FLIGHT_LEVEL)));

//using function for IsVisible so we have different results for different players - JAS 2019/09/30
if (Map.In_Radar(newcell) && (Session.Type != GAME_NORMAL || Map[newcell].Is_Visible(PlayerPtr)) && Cell_Seems_Ok(newcell, true)) {
if (Map.In_Radar(actualcell) && (Session.Type != GAME_NORMAL || Map[newcell].Is_Visible(PlayerPtr)) && Cell_Seems_Ok(newcell, true)) {
int dist;
if (altcoord != 0) {
dist = ::Distance(newcoord, altcoord);
Expand Down
10 changes: 7 additions & 3 deletions REDALERT/ANIM.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ IsTheaterShape = false;

AnimClass::Unlimbo(coord);

VisibleFlags = 0xffff;
VisibleFlags = static_cast<unsigned int>(-1);

/*
** Drop zone smoke always reveals the map around itself.
Expand Down Expand Up @@ -817,10 +817,10 @@ void AnimClass::AI(void)
int damage = Accum;
Accum -= damage;
if (As_Object(xObject)->Take_Damage(damage, 0, WARHEAD_FIRE) == RESULT_DESTROYED) {
delete this;
if (Target_Legal(VirtualAnimTarget)) {
delete As_Animation(VirtualAnimTarget);
}
delete this;
return;
}
}
Expand Down Expand Up @@ -1177,8 +1177,12 @@ void AnimClass::Detach(TARGET target, bool all)
assert(IsActive);

if (all) {
if (VirtualAnimTarget && VirtualAnimTarget == target) {
if (Target_Legal(VirtualAnimTarget) && VirtualAnimTarget == target) {
VirtualAnimTarget = TARGET_NONE;
if (IsInvisible) {
IsToDelete = true;
Mark(MARK_UP);
}
}
if (xObject == target) {
Map.Remove(this, In_Which_Layer());
Expand Down
27 changes: 21 additions & 6 deletions REDALERT/BUILDING.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ RadioMessageType BuildingClass::Receive_Message(RadioClass * from, RadioMessageT
case RADIO_CAN_LOAD:
TechnoClass::Receive_Message(from, message, param);
if (!House->Is_Ally(from)) return(RADIO_STATIC);
if (Mission == MISSION_CONSTRUCTION || Mission == MISSION_DECONSTRUCTION || BState == BSTATE_CONSTRUCTION || (!ScenarioInit && In_Radio_Contact() && Contact_With_Whom() != from)) return(RADIO_NEGATIVE);
if (Mission == MISSION_CONSTRUCTION || Mission == MISSION_DECONSTRUCTION || BState == BSTATE_CONSTRUCTION || (!ScenarioInit && Class->Type != STRUCT_REFINERY && In_Radio_Contact())) return(RADIO_NEGATIVE);
switch (Class->Type) {
case STRUCT_AIRSTRIP:
if (from->What_Am_I() == RTTI_AIRCRAFT && ((AircraftClass const *)from)->Class->IsFixedWing) {
Expand All @@ -200,7 +200,7 @@ RadioMessageType BuildingClass::Receive_Message(RadioClass * from, RadioMessageT
*((UnitClass *)from) == UNIT_HARVESTER &&
(ScenarioInit || !Is_Something_Attached())) {

return(RADIO_ROGER);
return((Contact_With_Whom() != from) ? RADIO_ROGER : RADIO_NEGATIVE);
}
break;

Expand Down Expand Up @@ -2572,13 +2572,21 @@ void BuildingClass::Grand_Opening(bool captured)
** to place it in a nearby location.
*/
if (!unit->Unlimbo(Cell_Coord(cell), DIR_W)) {
cell = unit->Nearby_Location(this);
/*
** Check multiple times for clear locations.
*/
for (int i = 0; i < 10; i++) {
cell = unit->Nearby_Location(this, i);
if (unit->Unlimbo(Cell_Coord(cell), DIR_SW)) {
break;
}
}

/*
** If the harvester could still not be placed, then refund the money
** to the owner and then bail.
*/
if (!unit->Unlimbo(Cell_Coord(cell), DIR_SW)) {
if (unit->IsInLimbo) {
House->Refund_Money(unit->Class->Cost_Of());
delete unit;
}
Expand Down Expand Up @@ -3726,9 +3734,16 @@ int BuildingClass::Mission_Deconstruction(void)
}
}

if (House->IsPlayerControl) {
// MBL 07.10.2020 - In 1v1, sometimes both players will hear this SFX, or neither player will hear it
// Making it so all players hear it positionally in the map; Per thread discussion in https://jaas.ea.com/browse/TDRA-7245
//
#if 0
if (House->IsPlayerControl) {
Sound_Effect(VOC_CASHTURN, Coord);
}
#else
Sound_Effect(VOC_CASHTURN, Coord);
}
#endif

/*
** Destroy all attached objects. ST - 4/24/2020 9:38PM
Expand Down
13 changes: 11 additions & 2 deletions REDALERT/CELL.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -2807,9 +2807,18 @@ void CellClass::Flag_Create(void)
{
if (!CTFFlag) {
CTFFlag = new AnimClass(ANIM_FLAG, Cell_Coord());
if (CTFFlag) {
CTFFlag->OwnerHouse = Owner;
if (CTFFlag == NULL) {
for (int i = 0; i < Anims.Count(); ++i) {
AnimClass* anim = Anims.Ptr(i);
if (*anim != ANIM_FLAG) {
delete anim;
break;
}
}
CTFFlag = new AnimClass(ANIM_FLAG, Cell_Coord());
}
assert(CTFFlag != NULL);
CTFFlag->OwnerHouse = Owner;
}
}

Expand Down
9 changes: 9 additions & 0 deletions REDALERT/DEFINES.H
Original file line number Diff line number Diff line change
Expand Up @@ -3615,6 +3615,15 @@ typedef enum OptionControlType : char {
} OptionControlType;


/****************************************************************************
** Used to store firing data for a unit.
*/
typedef struct {
COORDINATE Center;
int Distance;
} FireDataType;


#define size_of(typ,id) sizeof(((typ*)0)->id)


Expand Down
4 changes: 2 additions & 2 deletions REDALERT/DISPLAY.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -3146,9 +3146,9 @@ int DisplayClass::TacticalClass::Action(unsigned flags, KeyNumType & key)
object = Map.Close_Object(coord);

/*
** Special case check to ignore cloaked object if not owned by the player.
** Special case check to ignore cloaked object if not allied with the player.
*/
if (object != NULL && object->Is_Techno() && !((TechnoClass *)object)->IsOwnedByPlayer && (((TechnoClass *)object)->Cloak == CLOAKED || ((TechnoClass *)object)->Techno_Type_Class()->IsInvisible)) {
if (object != NULL && object->Is_Techno() && ((TechnoClass *)object)->Is_Cloaked(PlayerPtr, true)) {
object = NULL;
}
}
Expand Down
Loading

0 comments on commit ae72fce

Please sign in to comment.