Crash on advancing to second day

I got this crash with this console output:

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)
Network error receiving a pack. Connection Connection with VCMI 1.2.0.GITDIR-NOTFOUND (server) (ID: 1 UUID: 189e9f3f-a914-4cd7-9ef6-02028771ae7c) dies. What happened: read_some: End of file
Abgebrochen (Speicherabzug geschrieben)

As far as i see this, the check condition is true, not false (1 >= 1). So why the crash? Whatever caused this check. The log file simply terminates at some point, no useful info there. The console output is the best info source here.

I’m currently experimenting with Caitlins specialty, so this may be the cause. Her specialty is now:

		"specialty#override" : {
			"bonuses" : {
				"gold" : {
					"type" : "SECONDARY_SKILL_PREMY",
					"subtype" : "skill.gold",
					"val" : 10,
				},
			}
		}

The gold skill (a temporary replacement for the estates skill) is:

	"gold" : {
		"name" : "Gold Digger",
		"defaultGainChance" : 3,
		"gainChance" : {
			"might" : 3,
			"magic" : 3
		},
		"basic" : {
			"images" : {
				"small" : "skills/GoldSmall1.png",
				"medium" : "skills/GoldMedium1.png",
				"large" : "skills/GoldLarge1.png"
			},
			"description" : "{Basic Gold Digger}\n\ngenerates 250 gold per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.gold",
					"val" : 250
				}
			}
		},
		"advanced" : {
			"images" : {
				"small" : "skills/GoldSmall2.png",
				"medium" : "skills/GoldMedium2.png",
				"large" : "skills/GoldLarge2.png"
			},
			"description" : "{Advanced Gold Digger}\n\ngenerates 500 gold per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.gold",
					"val" : 500
				}
			}
		},
		"expert" : {
			"images" : {
				"small" : "skills/GoldSmall3.png",
				"medium" : "skills/GoldMedium3.png",
				"large" : "skills/GoldLarge3.png"
			},
			"description" : "{Expert Gold Digger}\n\ngenerates 1000 gold per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.gold",
					"val" : 1000
				}
			}
		}
	},

The skill seems to work, the specialty seems to do nothing.

Update: I think this crash is not related to the skill mod. I copied the specialty from the boost_core mod, and had the same crash. It crashed after movin focus to another application (the calculator, for calculating correctness of the mod, the check validated ok), and then moving focus back to the game window and clicking on next round button.

indexes in array start from 0 in most programming languages (including what VCMI uses). App tried to access array element with index 1 while array has only 1 element (i.e. at index 0) => “out of range” crash.

So a typical off-by-one bug. But then the error message is a bit misleading :slight_smile:

it’s misleading only to non-devs :slight_smile:

Well… :slight_smile:
Ok, only important is that it helps fixing bugs. At least i hope so.