mirror of
				https://github.com/bra1n/townsquare.git
				synced 2025-10-21 16:55:12 +00:00 
			
		
		
		
	fix negative nightOrder numbers causing a mess (fixes #193)
This commit is contained in:
		
							parent
							
								
									dc564f1d42
								
							
						
					
					
						commit
						37732d69c1
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -90,7 +90,8 @@ For base game characters, it is sufficient to only provide the ID, similar to wh | ||||||
|   _Note_: custom images will only be visible after enabling them in the Grimoire menu! |   _Note_: custom images will only be visible after enabling them in the Grimoire menu! | ||||||
| - **edition**: the ID of the edition for this character. can be left blank or "custom" | - **edition**: the ID of the edition for this character. can be left blank or "custom" | ||||||
| - **firstNight** / **otherNight**: the position that this character acts on the first / other nights, compared to all | - **firstNight** / **otherNight**: the position that this character acts on the first / other nights, compared to all | ||||||
|   other characters |   other characters<br> | ||||||
|  |   _Note_: must be a positive number or zero, with zero being treated as "does not act during the night" | ||||||
| - **firstNightReminder** / **otherNightReminder**: reminder text for first / other nights | - **firstNightReminder** / **otherNightReminder**: reminder text for first / other nights | ||||||
| - **reminders**: reminder tokens, should be an empty array `[]` if none | - **reminders**: reminder tokens, should be an empty array `[]` if none | ||||||
| - **remindersGlobal**: global reminder tokens that will always be available, no matter if the character is assigned to a player or not | - **remindersGlobal**: global reminder tokens that will always be available, no matter if the character is assigned to a player or not | ||||||
|  |  | ||||||
|  | @ -214,7 +214,7 @@ export default new Vuex.Store({ | ||||||
|             state.roles.get(role.id) || |             state.roles.get(role.id) || | ||||||
|             Object.assign({}, customRole, role) |             Object.assign({}, customRole, role) | ||||||
|         ) |         ) | ||||||
|         // default empty icons and placeholders
 |         // default empty icons and placeholders, clean up firstNight / otherNight
 | ||||||
|         .map(role => { |         .map(role => { | ||||||
|           if (rolesJSONbyId.get(role.id)) return role; |           if (rolesJSONbyId.get(role.id)) return role; | ||||||
|           role.imageAlt = // map team to generic icon
 |           role.imageAlt = // map team to generic icon
 | ||||||
|  | @ -225,6 +225,8 @@ export default new Vuex.Store({ | ||||||
|               demon: "evil", |               demon: "evil", | ||||||
|               fabled: "fabled" |               fabled: "fabled" | ||||||
|             }[role.team] || "custom"; |             }[role.team] || "custom"; | ||||||
|  |           role.firstNight = Math.abs(role.firstNight); | ||||||
|  |           role.otherNight = Math.abs(role.otherNight); | ||||||
|           return role; |           return role; | ||||||
|         }) |         }) | ||||||
|         // filter out roles that don't match an existing role and also don't have name/ability/team
 |         // filter out roles that don't match an existing role and also don't have name/ability/team
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue