MultiServer: if there is a hint cost, don't make it 0 (#1581)
This commit is contained in:
		
							parent
							
								
									03cf525b2c
								
							
						
					
					
						commit
						7e52b6d8bb
					
				| 
						 | 
					@ -597,7 +597,7 @@ class Context:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_hint_cost(self, slot):
 | 
					    def get_hint_cost(self, slot):
 | 
				
			||||||
        if self.hint_cost:
 | 
					        if self.hint_cost:
 | 
				
			||||||
            return max(0, int(self.hint_cost * 0.01 * len(self.locations[slot])))
 | 
					            return max(1, int(self.hint_cost * 0.01 * len(self.locations[slot])))
 | 
				
			||||||
        return 0
 | 
					        return 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def recheck_hints(self, team: typing.Optional[int] = None, slot: typing.Optional[int] = None):
 | 
					    def recheck_hints(self, team: typing.Optional[int] = None, slot: typing.Optional[int] = None):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								kvui.py
								
								
								
								
							
							
						
						
									
										6
									
								
								kvui.py
								
								
								
								
							| 
						 | 
					@ -148,9 +148,11 @@ class ServerLabel(HovererableLabel):
 | 
				
			||||||
                    for permission_name, permission_data in ctx.permissions.items():
 | 
					                    for permission_name, permission_data in ctx.permissions.items():
 | 
				
			||||||
                        text += f"\n    {permission_name}: {permission_data}"
 | 
					                        text += f"\n    {permission_name}: {permission_data}"
 | 
				
			||||||
                if ctx.hint_cost is not None and ctx.total_locations:
 | 
					                if ctx.hint_cost is not None and ctx.total_locations:
 | 
				
			||||||
 | 
					                    min_cost = int(ctx.server_version >= (0, 3, 9))
 | 
				
			||||||
                    text += f"\nA new !hint <itemname> costs {ctx.hint_cost}% of checks made. " \
 | 
					                    text += f"\nA new !hint <itemname> costs {ctx.hint_cost}% of checks made. " \
 | 
				
			||||||
                            f"For you this means every {max(0, int(ctx.hint_cost * 0.01 * ctx.total_locations))} " \
 | 
					                            f"For you this means every " \
 | 
				
			||||||
                            "location checks."
 | 
					                            f"{max(min_cost, int(ctx.hint_cost * 0.01 * ctx.total_locations))}" \
 | 
				
			||||||
 | 
					                            f" location checks."
 | 
				
			||||||
                elif ctx.hint_cost == 0:
 | 
					                elif ctx.hint_cost == 0:
 | 
				
			||||||
                    text += "\n!hint is free to use."
 | 
					                    text += "\n!hint is free to use."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue