My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once

#include <Util/Types.h>
#include <BW/Position.h>
#include <BW/Sprite.h>

#include <BW/Offsets.h>

namespace BW
{
#pragma pack(1)
// See Unit.h and compare this entire structure with the first part of the unit structure
// I'm not sure how much of it is the same so I didn't bother updating this.
struct Bullet
{
// v-- POSSIBLE SHARED BULLET/UNIT STRUCTURE BEGIN
/*0x00*/ BW::Bullet* prev;
/*0x04*/ BW::Bullet* next;
/*0x08*/ u32 unknown_0x08; //usually holds 1 (exists?)
/*0x0C*/ BW::Sprite *sprite; // sprite pointer
/*0x10*/ BW::Position unknown_0x10; //address? animation related? changes a during the same bullet
/*0x14*/ BW::Unit *unknown_0x14; //usually holds 0
/*0x18*/ BW::Position targetPosition;
/*0x1C*/ BW::Position targetPosition2; //usually same as targetPosition
/*0x20*/ u8 movementFlags; //usually holds 0x09 for probes, 0x0b for dragoons, 0x11 for mutas
/*0x21*/ u8 direction1; //not sure how this and direction2 differ from currentDirection and velocityDirection
/*0x22*/ u8 flingyTurnRadius;
/*0x23*/ u8 direction2;
/*0x24*/ u16 type;
/*0x26*/ u8 unknown_0x26;
/*0x27*/ u8 flingyMoveControl;
/*0x28*/ BW::Position position;
/*0x2C*/ POINT halt; // (xHalt >> 4) == xHalt
/*0x34*/ s32 flingyTopSpeed;
/*0x38*/ s32 unknown_0x38; //increasing counter or timer
/*0x3C*/ s32 unknown_0x3C; //increasing counter or timer, often the same value as unknown_0x38
/*0x40*/ POINT current_speed;
/*0x48*/ u16 flingyAcceleration;
/*0x4A*/ u8 currentDirection;
/*0x4B*/ u8 velocityDirection; //seems to always be the same as currentDirection
/*0x4C*/ u8 unknown_0x4C;
/*0x4D*/ u8 behaviourTypeInternal; // 0 = none
// 1 = fly
// 2 = fly & follow target
// 3 = bounce
// 4 = persist on site
// 5 = appear on target/instant
// 6 = attack target area
/*0x4E*/ u16 unknown_0x4E;
/*0x50*/ u16 someUnitType; //usually holds UnitTypes::None (Unknown unit type stuff?)
/*0x52*/ u16 unknown_0x52; // possibly padding
/*0x54*/ s32 unknown_0x54; //usually holds 0
/*0x58*/ BW::Position flyToPosition;
/*0x5C*/ BW::Unit* targetUnit;
// ^-- POSSIBLE SHARED BULLET/UNIT STRUCTURE END

/*0x60*/ u8 weaponType;
/*0x61*/ u8 time_remaining;
/*0x62*/ u8 hitFlags; // 0x01 = miss target; 0x02 = no damage (hallucination)
/*0x63*/ u8 remainingBounces; // Bounce count for mutalisk weapon (official name: ubChain)
/*0x64*/ BW::Unit* sourceUnit;
/*0x68*/ BW::Unit* nextBounceUnit; // Next unit for bounce, temporary
/*0x6C*/ u32 unknown_0x6C; // some sort of cyclic burst counter (used by valkyries, goliath air attack)
};

CTASSERT( sizeof(Bullet) == 112 );
#pragma pack()
};

Change log

r3988 by deathkni...@aim.com on Dec 13, 2011   Diff
- Added some compile time assertions for
BW structures.
- Fix a buffer overflow for isFlagEnabled.
- completeMapInfo is now enabled always
when onGameEnd is called.
Go to: 
Sign in to write a code review

Older revisions

r3985 by deathkni...@aim.com on Dec 8, 2011   Diff
Structure research, observations,
compactness.
r3772 by deathkni...@aim.com on Jul 23, 2011   Diff
Post-release commit.
Some minor research.
r3537 by deathkni...@aim.com on Mar 9, 2011   Diff
Some research for various places.
Remove one offset.
A couple isAlive changes. Shouldn't
alter any behaviour.
All revisions of this file

File info

Size: 3392 bytes, 68 lines
Powered by Google Project Hosting