summaryrefslogtreecommitdiffstats
path: root/src/peds/EmergencyPed.cpp
blob: d4f46b0ed5284eb924d59ae894d8842134508796 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "common.h"
#include "patcher.h"
#include "EmergencyPed.h"
#include "ModelIndices.h"

class CEmergencyPed_ : public CEmergencyPed
{
public:
	CEmergencyPed *ctor(int pedtype) { return ::new (this) CEmergencyPed(pedtype); };
	void dtor(void) { CEmergencyPed::~CEmergencyPed(); }
};

CEmergencyPed::CEmergencyPed(uint32 type) : CPed(type)
{
	switch (type){
	case PEDTYPE_EMERGENCY:
		SetModelIndex(MI_MEDIC);
		m_pRevivedPed = nil;
		field_1360 = 0;
		break;
	case PEDTYPE_FIREMAN:
		SetModelIndex(MI_FIREMAN);
		m_pRevivedPed = nil;
		break;
	default:
		break;
	}
	m_nEmergencyPedState = 0;
	m_pAttendedAccident = nil;
	field_1356 = 0;
}

STARTPATCHES
	InjectHook(0x4C2E40, &CEmergencyPed_::ctor, PATCH_JUMP);
	InjectHook(0x4C2EF0, &CEmergencyPed_::dtor, PATCH_JUMP);
ENDPATCHES