[Scummvm-git-logs] scummvm master -> 3f5752b81249b1724466a2e57ce00d2fd2f8e9b2

sev- sev at scummvm.org
Sun Jun 27 12:14:55 UTC 2021


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

Summary:
165d18f9e9 PARALLACTION: parse item for GIVE command correctly.
9881a9cdb4 PARALLACTION: store GIVE recipients as strings.
3f5752b812 PARALLACTION: implement GIVE command.


Commit: 165d18f9e9e7b2091df396d1306ead414955ebd5
    https://github.com/scummvm/scummvm/commit/165d18f9e9e7b2091df396d1306ead414955ebd5
Author: peres (peres at scummvm.org)
Date: 2021-06-27T14:14:50+02:00

Commit Message:
PARALLACTION: parse item for GIVE command correctly.

Changed paths:
    engines/parallaction/parser_br.cpp


diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 3a4a3d8dd6..dd944a78d6 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -653,7 +653,7 @@ DECLARE_COMMAND_PARSER(give)  {
 
 	createCommand(_parser->_lookup);
 
-	ctxt.cmd->_object = 4 + atoi(_tokens[1]);
+	ctxt.cmd->_object = 4 + _vm->_objectsNames->lookup(_tokens[1]);
 	ctxt.nextToken++;
 
 	if (!scumm_stricmp("dino", _tokens[2])) {


Commit: 9881a9cdb43d1374cf6ce9d4be0062204ca4dc7f
    https://github.com/scummvm/scummvm/commit/9881a9cdb43d1374cf6ce9d4be0062204ca4dc7f
Author: peres (peres at scummvm.org)
Date: 2021-06-27T14:14:50+02:00

Commit Message:
PARALLACTION: store GIVE recipients as strings.

Changed paths:
    engines/parallaction/objects.cpp
    engines/parallaction/objects.h
    engines/parallaction/parser_br.cpp


diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 9bcd344f06..f51acfb0d6 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -42,7 +42,6 @@ Command::Command() {
 	_zeta0 = 0;
 	_zeta1 = 0;
 	_zeta2 = 0;
-	_characterId = 0;
 	_musicCommand = 0;
 	_musicParm = 0;
 }
diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h
index 4dcb888413..9f97dd9cfe 100644
--- a/engines/parallaction/objects.h
+++ b/engines/parallaction/objects.h
@@ -130,7 +130,7 @@ struct Command {
 	int				_zeta0;
 	int				_zeta1;
 	int				_zeta2;
-	int				_characterId;
+	Common::String	_characterName;
 	Common::String	_string2;
 	int				_musicCommand;
 	int				_musicParm;
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index dd944a78d6..5da0d4b1e0 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -657,13 +657,13 @@ DECLARE_COMMAND_PARSER(give)  {
 	ctxt.nextToken++;
 
 	if (!scumm_stricmp("dino", _tokens[2])) {
-		ctxt.cmd->_characterId = 1;
+		ctxt.cmd->_characterName = "dino";
 	} else
 	if (!scumm_stricmp("doug", _tokens[2])) {
-		ctxt.cmd->_characterId = 2;
+		ctxt.cmd->_characterName = "doug";
 	} else
 	if (!scumm_stricmp("donna", _tokens[2])) {
-		ctxt.cmd->_characterId = 3;
+		ctxt.cmd->_characterName = "donna";
 	} else
 		error("unknown recipient '%s' in give command", _tokens[2]);
 


Commit: 3f5752b81249b1724466a2e57ce00d2fd2f8e9b2
    https://github.com/scummvm/scummvm/commit/3f5752b81249b1724466a2e57ce00d2fd2f8e9b2
Author: peres (peres at scummvm.org)
Date: 2021-06-27T14:14:50+02:00

Commit Message:
PARALLACTION: implement GIVE command.

Changed paths:
    engines/parallaction/exec_br.cpp


diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 4475a54640..790935364d 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -299,16 +299,14 @@ DECLARE_COMMAND_OPCODE(swap) {
 
 
 DECLARE_COMMAND_OPCODE(give) {
-	warning("Parallaction_br::cmdOp_give not yet implemented");
-
-	/* NOTE: the following code is disabled until I deal with _inventory and
-	 * _charInventories not being public
-	 */
-/*  int item = ctxt._cmd->_object;
-	int recipient = ctxt._cmd->_characterId;
-	_vm->_charInventories[recipient]->addItem(item);
+	int item = ctxt._cmd->_object;
+	Inventory *targetInventory = _vm->findInventory(ctxt._cmd->_characterName.c_str());
+
+	if (targetInventory) {
+		targetInventory->addItem(item);
+	}
+
 	_vm->_inventory->removeItem(item);
-*/
 }
 
 




More information about the Scummvm-git-logs mailing list