[Scummvm-git-logs] scummvm master -> 48f5fafa0269505a41a585b1220db40654a7e446

mduggan mgithub at guarana.org
Tue Mar 30 11:52:55 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
48f5fafa02 ULTIMA8: Fixes for Crusader large weapons by resolving some TODOs


Commit: 48f5fafa0269505a41a585b1220db40654a7e446
    https://github.com/scummvm/scummvm/commit/48f5fafa0269505a41a585b1220db40654a7e446
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-03-30T20:52:20+09:00

Commit Message:
ULTIMA8: Fixes for Crusader large weapons by resolving some TODOs

Changed paths:
    engines/ultima/ultima8/world/fire_type.cpp
    engines/ultima/ultima8/world/super_sprite_process.cpp
    engines/ultima/ultima8/world/super_sprite_process.h


diff --git a/engines/ultima/ultima8/world/fire_type.cpp b/engines/ultima/ultima8/world/fire_type.cpp
index e798ea5636..32cccbef64 100644
--- a/engines/ultima/ultima8/world/fire_type.cpp
+++ b/engines/ultima/ultima8/world/fire_type.cpp
@@ -83,7 +83,7 @@ void FireType::makeBulletSplashShapeAndPlaySound(int32 x, int32 y, int32 z) cons
 			sfxno = RANDOM_ELEM(FIRESOUND_3);
 			break;
 		case 5:
-			shape = 0x573;
+			shape = 0x537;
 			break;
 		case 6:
 			shape = 0x578;
@@ -126,7 +126,7 @@ void FireType::makeBulletSplashShapeAndPlaySound(int32 x, int32 y, int32 z) cons
 		lastframe = 10;
 		break;
 	case 0x578:
-		firstframe = (getRandom() % 3) * 6;
+		firstframe = (getRandom() % 3) * 5;
 		lastframe = firstframe + 4;
 		break;
 	case 0x59b:
diff --git a/engines/ultima/ultima8/world/super_sprite_process.cpp b/engines/ultima/ultima8/world/super_sprite_process.cpp
index 4a267336e2..81ecf5ee90 100644
--- a/engines/ultima/ultima8/world/super_sprite_process.cpp
+++ b/engines/ultima/ultima8/world/super_sprite_process.cpp
@@ -230,7 +230,7 @@ void SuperSpriteProcess::run() {
 
 	_counter++;
 
-	if (!_itemNum && _counter > 1) {
+	if (!_spriteNo && _counter > 1) {
 		Item *sprite = ItemFactory::createItem(_shape, _frame, 0, Item::FLG_DISPOSABLE,
 			0, 0, Item::EXT_SPRITE, true);
 		_spriteNo = sprite->getObjId();
@@ -362,6 +362,16 @@ void SuperSpriteProcess::hitAndFinish() {
 	destroyItemOrTerminate();
 }
 
+void SuperSpriteProcess::terminate() {
+	if (_spriteNo) {
+		Item *sprite = getItem(_spriteNo);
+		if (sprite)
+			sprite->destroy();
+		_spriteNo = 0;
+	}
+	Process::terminate();
+}
+
 void SuperSpriteProcess::destroyItemOrTerminate() {
 	if (_itemNum) {
 		Item *item = getItem(_itemNum);
@@ -377,21 +387,22 @@ void SuperSpriteProcess::destroyItemOrTerminate() {
 void SuperSpriteProcess::advanceFrame() {
 	_nextpt = _pt3;
 
-	if (_itemNum) {
-		warning("TODO: SuperSpriteProcess::advanceFrame: Implement area search 10e0_123a");
-		// TODO: do an area search for something here.
-		// AreaSearch_10e0_123a
+	Item *item = getItem(_itemNum);
+	if (item) {
+		item->collideMove(_pt3.x, _pt3.y, _pt3.z, false, false);
 	}
 
 	if (_spriteNo) {
 		Item *sprite = getItem(_spriteNo);
 		assert(sprite);
 		sprite->move(_nextpt);
-		uint32 frame = sprite->getFrame();
-		frame++;
-		if (frame > 0x4b)
-			frame = 0x47;
-		sprite->setFrame(frame);
+		if (_fireType == 0xe) {
+			uint32 frame = sprite->getFrame();
+			frame++;
+			if (frame > 0x4b)
+				frame = 0x47;
+			sprite->setFrame(frame);
+		}
 	}
 
 	if (_fireType == 3) {
@@ -405,22 +416,25 @@ void SuperSpriteProcess::advanceFrame() {
 }
 
 bool SuperSpriteProcess::areaSearch() {
-	// int x1, int y1, int z1, int x2, int y2, int z2
 	CurrentMap *map = World::get_instance()->getCurrentMap();
 
-	warning("TODO: SuperSpriteProcess::areaSearch: Implement area search 1138_0ee8");
-	// TODO: Implement SuperSprite_AreaSearch_1138_0ee8
-	uint16 lsrange = _pt3.maxDistXYZ(_nextpt);
-	UCList uclist(2);
-	LOOPSCRIPT(script, LS_TOKEN_TRUE); // we want all items
-	map->areaSearch(&uclist, script, sizeof(script), nullptr,
-					lsrange, true, _nextpt.x, _nextpt.y);
-	for (unsigned int i = 0; i < uclist.getSize(); ++i) {
-		Item *searchitem = getItem(uclist.getuint16(i));
-		assert(searchitem);
+	int32 start[3] = {_nowpt.x, _nowpt.y, _nowpt.z};
+	int32 end[3] = {_pt3.x, _pt3.y, _pt3.z};
+	int32 dims[3] = {1, 1, 1};
+
+	Item *item = getItem(_itemNum);
+	if (item)
+		item->getLocation(start[0], start[1], start[2]);
+
+	Std::list<CurrentMap::SweepItem> hits;
+	bool collision = map->sweepTest(start, end, dims, ShapeInfo::SI_SOLID,
+							   _source, true, &hits);
+
+	if (hits.size() > 0) {
+		_item0x77 = hits.front()._item;
 	}
 
-	return false;
+	return !collision;
 }
 
 
diff --git a/engines/ultima/ultima8/world/super_sprite_process.h b/engines/ultima/ultima8/world/super_sprite_process.h
index 162284b011..ba75f51cb7 100644
--- a/engines/ultima/ultima8/world/super_sprite_process.h
+++ b/engines/ultima/ultima8/world/super_sprite_process.h
@@ -91,6 +91,8 @@ public:
 	bool loadData(Common::ReadStream *rs, uint32 version);
 	void saveData(Common::WriteStream *ws) override;
 
+	void terminate() override;
+
 protected:
 	bool areaSearch();
 	void advanceFrame();




More information about the Scummvm-git-logs mailing list