Commit graph

23 commits

Author SHA1 Message Date
vobject a7099aa63a Fix copy&paste error in AI 2014-01-07 21:57:27 +01:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +00:00
Kp 89a5450bfc Fix memory overread when saving Boss_dying_sound_playing
AddressSanitizer reports that Boss_dying_sound_playing is saved as an
int, but occupies only one byte.
2014-01-01 03:30:36 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp 510fe02825 Use on stack array<> for New_awareness 2013-12-31 00:12:08 +00:00
Kp 7cf6877e2a Rename D1 ai_local::wait_time to ::next_action_time to match D2 2013-12-29 04:33:30 +00:00
Kp cf5343db18 Move ai_local into ai_static
Eliminates a global and some pointer math.
2013-12-29 03:59:21 +00:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp 3563bfb85a Enable Descent II divide-by-zero check in Descent too 2013-12-28 22:45:27 +00:00
Kp 8a83c93c8c Move ai_local_read_n_swap loop into caller 2013-12-28 22:21:00 +00:00
Kp 16f1044930 Switch init_ai_objects to range_for to eliminate a variable 2013-12-28 22:10:24 +00:00
Kp 38b2dbe639 Move object* -> objnum conversion into init_ai_object 2013-12-28 22:10:24 +00:00
Kp 25e95936d5 When pursuing player, avoid segment_none instead of segment 1
Avoiding segment 1 makes no sense, and appears to be a bug.
2013-12-25 04:39:16 +00:00
Kp 44f1814b45 Store boss gate/teleport segments in countarray objects 2013-12-22 20:02:42 +00:00
Kp 99626b2f34 Clear visited segment array in constructor 2013-12-22 05:27:46 +00:00
Kp c31c67c587 Store selected segments in countarray object 2013-12-22 01:54:15 +00:00
Kp 4fb6990b6c Make Stolen_items[] a C++ array 2013-12-22 01:53:26 +00:00
Kp f05b6f0008 Use on-stack bit array for tracking AI segment visits 2013-12-15 18:50:39 +00:00
Kp 2bd302cddd Move Controls ubyte values into substructure 2013-12-13 03:47:57 +00:00
Kp 4d877c5d67 Move ai_save_state *_rw onto stack 2013-12-08 18:26:19 +00:00
Kp 70caa4e7b6 Fix array understep in guidebot flare code 2013-12-06 03:36:07 +00:00
Kp a4855dbdb3 Use stricter check for robots in set_player_awareness_all
Rather than tracking down every path through which an object can have
its type set to OBJ_NONE without clearing its control_type, add an
explicit check that the type is OBJ_ROBOT.
2013-11-24 23:11:30 +00:00
Kp 53149e6bcd Move similar/main/ai.c -> similar/main/ai.cpp 2013-11-23 22:47:45 +00:00
Renamed from similar/main/ai.c (Browse further)