From 47e7ab21cc6b64144bd686d475371d50871ebb4d Mon Sep 17 00:00:00 2001
From: Braden Obrzut <admin@maniacsvault.net>
Date: Fri, 22 Feb 2013 18:42:26 +0000
Subject: [PATCH] - Fixed: strcpy on map arrays didn't properly translate the
 array number.

SVN r4160 (trunk)
---
 src/p_acs.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/p_acs.cpp b/src/p_acs.cpp
index e2a844d61..7bfc87f39 100644
--- a/src/p_acs.cpp
+++ b/src/p_acs.cpp
@@ -7327,7 +7327,12 @@ scriptwait:
 				{
 					case PCD_STRCPYTOMAPCHRANGE:
 						{
-							Stack[sp-6] = activeBehavior->CopyStringToArray(STACK(5), index, capacity, lookup);
+							int a = STACK(5);
+							if (a < NUM_MAPVARS && a > 0 &&
+								activeBehavior->MapVars[a])
+							{
+								Stack[sp-6] = activeBehavior->CopyStringToArray(*(activeBehavior->MapVars[a]), index, capacity, lookup);
+							}
 						}
 						break;
 					case PCD_STRCPYTOWORLDCHRANGE: