Skip to content

Commit

Permalink
Revert "Spectators need health too. #SpectatorLivesMatter"
Browse files Browse the repository at this point in the history
This reverts commit b0f14e1.
  • Loading branch information
DolceTriade committed Dec 28, 2015
1 parent b22eaba commit 2a6280a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/sgame/components/SpectatorComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "SpectatorComponent.h"

SpectatorComponent::SpectatorComponent(Entity& entity, ClientComponent& r_ClientComponent, HealthComponent& r_HealthComponent)
: SpectatorComponentBase(entity, r_ClientComponent, r_HealthComponent)
SpectatorComponent::SpectatorComponent(Entity& entity, ClientComponent& r_ClientComponent)
: SpectatorComponentBase(entity, r_ClientComponent)
{}

void SpectatorComponent::HandlePrepareNetCode() {
Expand Down
45 changes: 22 additions & 23 deletions src/sgame/components/SpectatorComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@
#include "../backend/CBSEComponents.h"

class SpectatorComponent: public SpectatorComponentBase {
public:
// ///////////////////// //
// Autogenerated Members //
// ///////////////////// //

/**
* @brief Default constructor of the SpectatorComponent.
* @param entity The entity that owns the component instance.
* @param r_ClientComponent A ClientComponent instance that this component depends on.
* @param r_HealthComponent A HealthComponent instance that this component depends on.
* @note This method is an interface for autogenerated code, do not modify its signature.
*/
SpectatorComponent(Entity& entity, ClientComponent& r_ClientComponent, HealthComponent& r_HealthComponent);

/**
* @brief Handle the PrepareNetCode message.
* @note This method is an interface for autogenerated code, do not modify its signature.
*/
void HandlePrepareNetCode();

// ///////////////////// //

private:
public:
// ///////////////////// //
// Autogenerated Members //
// ///////////////////// //

/**
* @brief Default constructor of the SpectatorComponent.
* @param entity The entity that owns the component instance.
* @param r_ClientComponent A ClientComponent instance that this component depends on.
* @note This method is an interface for autogenerated code, do not modify its signature.
*/
SpectatorComponent(Entity& entity, ClientComponent& r_ClientComponent);

/**
* @brief Handle the PrepareNetCode message.
* @note This method is an interface for autogenerated code, do not modify its signature.
*/
void HandlePrepareNetCode();

// ///////////////////// //

private:

};

Expand Down
1 change: 0 additions & 1 deletion src/sgame/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ components:
- PrepareNetCode
requires:
- Client
- Health

AlienClass:
requires:
Expand Down
5 changes: 4 additions & 1 deletion src/sgame/sg_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,10 @@ static void ClientSpawnCBSE(gentity_t *ent, bool evolving) {
// - Call assignment operators on the new components to transfer state from old entity.

case PCL_NONE:
CLIENT_ENTITY_CREATE(SpectatorEntity);
SpectatorEntity::Params params;
params.oldEnt = ent;
params.Client_clientData = client;
ent->entity = new SpectatorEntity(params);
break;

case PCL_ALIEN_BUILDER0: {
Expand Down

0 comments on commit 2a6280a

Please sign in to comment.